1<?php 2require_once 'PHPUnit/Framework.php'; 3require_once dirname(__FILE__) . '/../src/gtAutoload.php'; 4 5 6class gtIsValidClassTest extends PHPUnit_Framework_TestCase { 7 8 public function testValid() { 9 10 $clo = new gtCommandLineOptions(); 11 $clo->parse(array('generate-phpt.php', '-c', 'DOMDocument')); 12 $ch = new gtIsValidClass(); 13 $this->assertTrue($ch->check($clo)); 14 } 15 16 public function testNotValid() { 17 18 $clo = new gtCommandLineOptions(); 19 $clo->parse(array('generate-phpt.php', '-c', 'blah')); 20 $ch = new gtIsValidClass(); 21 $this->assertFalse($ch->check($clo)); 22 } 23 24 public function testNotGiven() { 25 26 $clo = new gtCommandLineOptions(); 27 $clo->parse(array('generate-phpt.php','-b')); 28 $ch = new gtIsValidClass(); 29 $this->assertTrue($ch->check($clo)); 30 } 31 32 public function testMessage() { 33 34 $clo = new gtCommandLineOptions(); 35 $clo->parse(array('generate-phpt.php', '-c', 'blah')); 36 $ch = new gtIsvalidClass(); 37 $this->assertEquals($ch->getMessage(), gtText::get('unknownClass')); 38 } 39} 40 41?> 42