Exemplo n.º 1
0
 public function testCommandLineReader()
 {
     $values = array('test' => null, 'verbose' => null, 'vagrant' => '/path/to/vagrant', 'vagrant-output-file' => 'output.file', 'vagrant-output-dir' => '/output/dir', 'no-upload' => null, 'upload-method' => 'upload', 'no-bump-version' => null, 'keep-package' => null, 'config-file' => '/path/to/config', 'metadata-file' => '/path/to/metadata', 'force-write-metadata' => null, 'base' => '/base/dir', 'boxer-id' => 'test-boxer-id', 'url-prefix' => 'before-url', 'url-suffix' => 'after-url', 'upload-base-uri' => 'localhost:/tmp', 'major-version' => '0.1.2.3.4.5');
     $allArgs = array(self::app);
     // $0 == /path/to/app
     foreach ($values as $n => $v) {
         $allArgs[] = "--{$n}";
         if ($v !== null) {
             $allArgs[] = $v;
         }
     }
     $box = new Boxer();
     $box->silenceStderr();
     $box->readCommandLine($allArgs);
     $this->assertTrue($box->isTestMode(), "Expected test mode to be enabled");
     $this->assertSame($values['boxer-id'], $box->getBoxerId());
 }