1<?php
2require_once 'PHPUnit/Framework.php';
3require_once dirname(__FILE__) . '/../src/gtAutoload.php';
4
5
6class gtIsSpecifiedTestTypeTest extends PHPUnit_Framework_TestCase {
7
8  public function testValid() {
9
10    $clo = new gtCommandLineOptions();
11    $clo->parse(array('generate-phpt.php', '-c', 'DOMDocument','-b'));
12    $ch = new gtIsSpecifiedTestType();
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', 'DOMDocument'));
20    $ch = new gtIsSpecifiedTestType();
21    $this->assertFalse($ch->check($clo));
22  }
23
24  public function testMessage() {
25
26    $clo = new gtCommandLineOptions();
27    $clo->parse(array('generate-phpt.php', '-c', 'blah'));
28    $ch = new gtIsSpecifiedtestType();
29    $this->assertEquals($ch->getMessage(), gtText::get('testTypeNotSpecified'));
30  }
31}
32?>