more follow-up to r65715: coding style tweaks, etc.
[lhc/web/wiklou.git] / maintenance / tests / selenium / SeleniumTestCase.php
1 <?php
2 if ( !defined( 'MEDIAWIKI' ) || !defined( 'SELENIUMTEST' ) ) {
3 echo "This script cannot be run standalone";
4 exit( 1 );
5 }
6
7 class SeleniumTestCase extends PHPUnit_Framework_TestCase { //PHPUnit_Extensions_SeleniumTestCase
8 protected $selenium;
9
10 public function setUp() {
11 set_time_limit( 60 );
12 $this->selenium = Selenium::getInstance();
13 }
14
15 public function tearDown() {
16
17 }
18
19 public function __call( $method, $args ) {
20 return call_user_func_array( array( $this->selenium, $method ), $args );
21 }
22
23 public function assertSeleniumAttributeEquals( $attribute, $value ) {
24 $attr = $this->getAttribute( $attribute );
25 $this->assertEquals( $attr, $value );
26 }
27
28 public function assertSeleniumHTMLContains( $element, $text ) {
29 $innerHTML = $this->getText( $element );
30 // or assertContains
31 $this->assertRegExp( "/$text/", $innerHTML );
32 }
33
34 }