sebastianbergmann/phpunit-selenium — Issue #69: setUpBeforeClass and tearDownAfterClass not called (fix included)
Author: chrfin
Created: 2011-11-11 12:02:19+00:00
State: open

If using a SeleniumTestCase the setUpBeforeClass and tearDownAfterClass methods are not called, because the `$testCase` member of the TestSuite is `false`.

I fixed that by extending the TestSuite like following and use it in SeleniumTestCase.php on Ln355 like `$suite = new PHPUnit_Extensions_SeleniumTestSuite;`:
```php

* @copyright 2011 Schlaue-Kids.net
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @since File available since Release 1.2.0
*/

/**
* TestSuitee class that is used by PHPUnit_Extensions_SeleniumTestCase to provide
* setUpBeforeClass and tearDownAfterClass functionality.
*
* @package PHPUnit_Selenium
* @author Schlaue-Kids.net
* @copyright 2011 Schlaue-Kids.net
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: 1.2.0
* @since Class available since Release 1.2.0
*/
class PHPUnit_Extensions_SeleniumTestSuite extends PHPUnit_Framework_TestSuite
{
/**
* Constructs a new TestSuite:
*
* ORIGINAL EXPLANATION GOES HERE (not included to make it better readable)
*
* @param mixed $theClass
* @param string $name
* @throws InvalidArgumentException
*/
public function __construct($theClass = '', $name = '')
{
parent::__construct($theClass, $name);
$this->testCase = TRUE;
}
}
```