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()); }