Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
- class WebTest extends PHPUnit_Extensions_SeleniumTestCase
- {
- protected function setUp()
- {
- $this->setBrowser('*firefox');
- $this->setBrowserUrl('http://www.example.com/');
- }
- public function testTitle()
- {
- $this->open('http://www.example.com/');
- $this->assertTitleEquals('Example Web Page');
- }
- }
- /PEAR/PHPUnit/Extensions/SeleniumTestCase.php
- pear uninstall phpunit/PHPUnit
- pear uninstall phpunit/PHPUnit_Selenium
- pear install phpunit/PHPUnit
- pear install phpunit/PHPUnit_Selenium
- <?php
- require_once 'PHPUnit/Framework.php';
- class StackTest extends PHPUnit_Framework_TestCase
- {
- public function testPushAndPop()
- {
- $stack = array();
- $this->assertEquals(0, count($stack));
- array_push($stack, 'foo');
- $this->assertEquals('foo', $stack[count($stack)-1]);
- $this->assertEquals(1, count($stack));
- $this->assertEquals('foo', array_pop($stack));
- $this->assertEquals(0, count($stack));
- }
- }
- ?>
Add Comment
Please, Sign In to add comment