Back to index

php5  5.3.10
gtIsSpecifiedFunctionOrMethodTest.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 gtIsSpecifiedFunctionOrMethodTest extends PHPUnit_Framework_TestCase {
00007 
00008   public function testValid() {
00009 
00010     $clo = new gtCommandLineOptions();
00011     $clo->parse(array('generate-phpt.php', '-m', 'blah'));
00012     $ch = new gtIsSpecifiedFunctionOrMethod();
00013     $this->assertTrue($ch->check($clo));
00014   }
00015 
00016   public function testValid2() {
00017 
00018     $clo = new gtCommandLineOptions();
00019     $clo->parse(array('generate-phpt.php', '-f', 'blah'));
00020     $ch = new gtIsSpecifiedFunctionOrMethod();
00021     $this->assertTrue($ch->check($clo));
00022   }
00023   
00024    public function testNotValid() {
00025 
00026     $clo = new gtCommandLineOptions();
00027     $clo->parse(array('generate-phpt.php', '-b'));
00028     $ch = new gtIsSpecifiedFunctionOrMethod();
00029     $this->assertFalse($ch->check($clo));
00030     
00031   }
00032   
00033   public function testMessage() {
00034 
00035     $clo = new gtCommandLineOptions();
00036     $clo->parse(array('generate-phpt.php', '-c', 'blah'));
00037     $ch = new gtIsSpecifiedFunctionOrMethod();
00038     $this->assertEquals($ch->getMessage(), gtText::get('functionOrMethodNotSpecified'));
00039   }
00040 }
00041 ?>