Back to index

php5  5.3.10
gtIfClassHasMethodTest.php
Go to the documentation of this file.
00001 <?php
00002 require_once 'PHPUnit/Framework.php';
00003 require_once dirname(__FILE__) . '/../src/gtAutoload.php';
00004 
00005 
00006 class gtIfClassHasMethodTest extends PHPUnit_Framework_TestCase {
00007 
00008   public function testValid() {
00009 
00010     $clo = new gtCommandLineOptions();
00011     $clo->parse(array('generate-phpt.php', '-c', 'blah', '-m', 'blah'));
00012     $ch = new gtIfClassHasMethod();
00013     $this->assertTrue($ch->check($clo));
00014   }
00015 
00016   public function testNotValid() {
00017 
00018     $clo = new gtCommandLineOptions();
00019     $clo->parse(array('generate-phpt.php', '-c', 'blah'));
00020     $ch = new gtIfClassHasMethod();
00021     $this->assertFalse($ch->check($clo));
00022   }
00023 
00024   public function testNotSpecified() {
00025 
00026     $clo = new gtCommandLineOptions();
00027     $clo->parse(array('generate-phpt.php', '-b'));
00028     $ch = new gtIfClassHasMethod();
00029     $this->assertTrue($ch->check($clo));
00030   }
00031 
00032   public function testMessage() {
00033 
00034     $clo = new gtCommandLineOptions();
00035     $clo->parse(array('generate-phpt.php', '-c', 'blah'));
00036     $ch = new gtIfClassHasMethod();
00037     $this->assertEquals($ch->getMessage(), gtText::get('methodNotSpecified'));
00038   }
00039 }
00040 
00041 ?>