code_junkie

How do I solve this error: “Class PHPUnit_Extensions_SeleniumTestCase could not be found”

Nov 10th, 2011
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
  2.  
  3. class WebTest extends PHPUnit_Extensions_SeleniumTestCase
  4. {
  5. protected function setUp()
  6. {
  7. $this->setBrowser('*firefox');
  8. $this->setBrowserUrl('http://www.example.com/');
  9. }
  10.  
  11. public function testTitle()
  12. {
  13. $this->open('http://www.example.com/');
  14. $this->assertTitleEquals('Example Web Page');
  15. }
  16. }
  17.  
  18. /PEAR/PHPUnit/Extensions/SeleniumTestCase.php
  19.  
  20. pear uninstall phpunit/PHPUnit
  21.  
  22. pear uninstall phpunit/PHPUnit_Selenium
  23.  
  24. pear install phpunit/PHPUnit
  25.  
  26. pear install phpunit/PHPUnit_Selenium
  27.  
  28. <?php
  29. require_once 'PHPUnit/Framework.php';
  30.  
  31. class StackTest extends PHPUnit_Framework_TestCase
  32. {
  33. public function testPushAndPop()
  34. {
  35. $stack = array();
  36. $this->assertEquals(0, count($stack));
  37.  
  38. array_push($stack, 'foo');
  39. $this->assertEquals('foo', $stack[count($stack)-1]);
  40. $this->assertEquals(1, count($stack));
  41.  
  42. $this->assertEquals('foo', array_pop($stack));
  43. $this->assertEquals(0, count($stack));
  44. }
  45. }
  46. ?>
Add Comment
Please, Sign In to add comment