gtIsSpecifiedFunctionOrMethodTest.php 1.1 KB

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