예제 #1
0
파일: FlagsTest.php 프로젝트: donatj/flags
 public function testParsed()
 {
     $flags = new Flags();
     $this->assertSame(false, $flags->parsed());
     try {
         $flags->parse(explode(' ', 'test.php --failtoparse=true'));
         $this->fail('An exception should have been thrown.');
     } catch (\Exception $e) {
         //This is expected to fail. We're simply making sure it didn't parse.
     }
     $this->assertSame(false, $flags->parsed());
     $flags->parse(explode(' ', 'test.php a b c'));
     $this->assertSame(true, $flags->parsed());
 }