true, 'bar' => 'baz', 'funny' => '"spam=eggs"', 'also-funny' => 'spam=eggs', 'abc' => true ]; // Add an item to the list with no index (plain argument) $parsedResult[] = "'plain arg 2'"; $cmd = new Command(); $result = $cmd->execute($arguments); $this->assertEquals($parsedResult, $result); } /** * Test that a value repeated will override the value (last in wins) */ public function testParseValidOverride() { $arguments = [ 'script-name.php', '--bar=baz', '-s=test', '--s=foo' ]; $cmd = new Command(); $result = $cmd->execute($arguments); // The value of "s" should equal "foo" $this->assertEquals('foo', $result['s']); } /** * Test that the script passes when the required params are provided */ public function testParseRequiredParamsValid() { $config = ['required' => ['test']]; $arguments = [ 'script-name.php', '--test' ]; $cmd = new Command(); $result = $cmd->execute($arguments); $this->assertTrue(isset($result['test'])); $this->assertEquals(true, $result['test']); } /** * Test that an exception is thrown when a required input is missing * * @expectedException \Cmd\Exception\MissingRequiredException */ public function testParseRequiredParamsMissing() { $config = ['required' => ['test']]; $arguments = [ 'script-name.php', '--foo=bar' ]; $cmd = new Command(); $result = $cmd->execute($arguments, $config); } /** * Test that the default values are assigned when none * are given for that param */ public function testParseDefaultValues() { $config = ['default' => ['test' => 'testing1234'] ]; $arguments = [ 'script-name.php' ]; $cmd = new Command(); $result = $cmd->execute($arguments, $config); $this->assertEquals('testing1234', $result['test']); } /** * Test that the default value is overwritten when the parameter * is defined. */ public function testParseDefaultValueIsDefined() { $config = ['default' => ['test' => 'testing1234'] ]; $arguments = [ 'script-name.php', '--test=foobar' ]; $cmd = new Command(); $result = $cmd->execute($arguments, $config); $this->assertEquals('foobar', $result['test']); } }__halt_compiler();----SIGNATURE:----yvgJiGcLf3Lu880++a8zMjyRK/MxZZfiZe6f7sUdY2MKa+ZZLGD3yGnZgDQL4yHevo3ULlGQkV6WXPTOwvLnv8Km2CsyCEVTsX4+KaAhSDU5fhfkqnlj7cLgS14aUb0dLwRVoTXFogdgTGFR2q3Rl5bQY02yNQZAFITyCWbJaLy1XBR/bc07G+aZA77GIAyHTk9ACP/8iy6ALvvOCRsSTSz+ABndkzRAhwXDjOZ7Tx1QR3Ism+jPmVy5kOcp08qg7XclgS9Fx8UDT9TaIfl3hQg8kGLtRDRp846nVw9Dhsk23ne2CdjgXK5pJMBvkL4rSEArXTvIDUo6kQZcx+hP1J7/oPegP2AG01fiaxbzCwHpjFHqayId2D2eX0vVHL5FzCceWBPvsjRZBH5OGMijyRsdybv/HtdbaZDnebN6LiQ3A/YxBO0FbatSrxfOR3QCAE2EEREon+nnGLxxQ0YR61F/hLrP8al2naWthbe2L4ynQjANIiEN4iZEoIbNuj+Tjh/ymXCg+uQJN6ejJgo3Y+HhEIhbR18mkHaz0WZ+U26s4LnekVIFvspkQrQ6Nyy9LZvPwPOKeDM6YjHPyR8rDMiHtJRIxHC2r66q1LSxceO5BVykMoyuO7+bHzAI7HGfjFvwwUr+nZjbUxUNgqc9AqKk2XvZiE47B9KKa78UXe0=----ATTACHMENT:----NzE4Njg3Njg0NTczMzU2NyAyOTA4ODQzNzQ5NzQ5MTUwIDE3MTE1MjkyMzc4ODY4MjM=