1<?php
2require_once 'PHPUnit/Framework.php';
3require_once dirname(__FILE__) . '/../src/gtAutoload.php';
4
5
6class gtIfClassHasMethodTest extends PHPUnit_Framework_TestCase {
7
8  public function testValid() {
9
10    $clo = new gtCommandLineOptions();
11    $clo->parse(array('generate-phpt.php', '-c', 'blah', '-m', 'blah'));
12    $ch = new gtIfClassHasMethod();
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 gtIfClassHasMethod();
21    $this->assertFalse($ch->check($clo));
22  }
23
24  public function testNotSpecified() {
25
26    $clo = new gtCommandLineOptions();
27    $clo->parse(array('generate-phpt.php', '-b'));
28    $ch = new gtIfClassHasMethod();
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 gtIfClassHasMethod();
37    $this->assertEquals($ch->getMessage(), gtText::get('methodNotSpecified'));
38  }
39}
40
41?>