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