Guest User

Untitled

a guest
Feb 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php
  2.  
  3. require_once 'PHPUnit/Framework.php';
  4.  
  5. class CodeGenerationTest extends PHPUnit_Framework_TestCase
  6. {
  7. protected function setUp()
  8. {
  9. if (file_exists('a'))
  10. {
  11. unlink('a');
  12. }
  13. if (file_exists('b'))
  14. {
  15. unlink('b');
  16. }
  17. }
  18.  
  19. private function subtest($name)
  20. {
  21. file_put_contents($name, $name);
  22.  
  23. ob_start();
  24. include($name);
  25. $result = ob_get_clean();
  26. $this->assertEquals($name, $result, "Testing $name");
  27.  
  28. usleep(400000);
  29. }
  30.  
  31. public function test1()
  32. {
  33. $this->subtest('a');
  34. }
  35. public function test2()
  36. {
  37. $this->subtest('b');
  38. }
  39. public function test3()
  40. {
  41. $this->subtest('a');
  42. }
  43. public function test4()
  44. {
  45. $this->subtest('b');
  46. }
  47. }
Add Comment
Please, Sign In to add comment