diff --git a/.travis.yml b/.travis.yml index 2f72936..1f776e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: php before_script: - composer install - cd tests +dist: precise php: - 5.3 - 5.4 diff --git a/src/Commando/Command.php b/src/Commando/Command.php index bcf2ebb..e4835a1 100755 --- a/src/Commando/Command.php +++ b/src/Commando/Command.php @@ -206,6 +206,13 @@ public function __call($name, $arguments) return $this; } + public function getTokens() { + if (empty($this->tokens)){ + return array(); + } + return $this->tokens; + } + /** * @param Option|null $option * @param string|int $name diff --git a/tests/Commando/CommandTest.php b/tests/Commando/CommandTest.php index 40a05c1..ba9236d 100755 --- a/tests/Commando/CommandTest.php +++ b/tests/Commando/CommandTest.php @@ -206,4 +206,12 @@ public function testRequirementsOnOptionsMissing() ->needs('b'); } + public function testGetTokensPassedToCommand() + { + $tokens = array('-a'); + $cmd = new Command($tokens); + $retrievedTokens = $cmd->getTokens(); + $this->assertEquals($tokens, $retrievedTokens); + } + } \ No newline at end of file