gtVariationTestCaseFunctionTest.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. require_once 'PHPUnit/Framework.php';
  3. require_once dirname(__FILE__) . '/../src/gtAutoload.php';
  4. class gtVariationTestCaseFunctionTest extends PHPUnit_Framework_TestCase {
  5. public function testTestCase() {
  6. $f = new gtFunction('cos');
  7. $f->setArgumentNames();
  8. $f->setArgumentLists();
  9. $optSect = new gtOptionalSections();
  10. $vtc = gtVariationTestCase::getInstance($optSect);
  11. $vtc->setUp($f, 1, 'int');
  12. $vtc->constructTestCase();
  13. $fs = $vtc->toString();
  14. $this->assertTrue(is_string($fs));
  15. }
  16. public function testTestCase2() {
  17. $f = new gtFunction('date_sunrise');
  18. $f->setArgumentNames();
  19. $f->setArgumentLists();
  20. $a = $f->getMandatoryArgumentNames();
  21. $optSect = new gtOptionalSections();
  22. $vtc = gtVariationTestCase::getInstance($optSect);
  23. $vtc->setUp($f, 6, 'int');
  24. $vtc->constructTestCase();
  25. $fs = $vtc->toString();
  26. $this->assertTrue(is_string($fs));
  27. }
  28. public function testTestCase3() {
  29. $f = new gtFunction('date_sunrise');
  30. $f->setArgumentNames();
  31. $f->setArgumentLists();
  32. $optSect = new gtOptionalSections();
  33. $vtc = gtVariationTestCase::getInstance($optSect);
  34. $vtc->setUp($f, 6, 'array');
  35. $vtc->constructTestCase();
  36. $fs = $vtc->toString();
  37. $this->assertTrue(is_string($fs));
  38. }
  39. }
  40. ?>