Back to index

php5  5.3.10
gtIsSpecifiedTestTypeTest.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 gtIsSpecifiedTestTypeTest extends PHPUnit_Framework_TestCase {
00007 
00008   public function testValid() {
00009 
00010     $clo = new gtCommandLineOptions();
00011     $clo->parse(array('generate-phpt.php', '-c', 'DOMDocument','-b'));
00012     $ch = new gtIsSpecifiedTestType();
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', 'DOMDocument'));
00020     $ch = new gtIsSpecifiedTestType();
00021     $this->assertFalse($ch->check($clo));
00022   }
00023   
00024   public function testMessage() {
00025 
00026     $clo = new gtCommandLineOptions();
00027     $clo->parse(array('generate-phpt.php', '-c', 'blah'));
00028     $ch = new gtIsSpecifiedtestType();
00029     $this->assertEquals($ch->getMessage(), gtText::get('testTypeNotSpecified'));
00030   }
00031 }
00032 ?>