sebastianbergmann/phpunit-selenium — Issue #82: annotation @depends does not work
Author: emaks
Created: 2012-01-10 16:06:05+00:00
State: open

if extends test class from PHPUnit/Extensions/SeleniumTestCase annotation @depends does not work

test example:

class test extends PHPUnit_Extensions_SeleniumTestCase
{

function setUp()
{
$this->setBrowser("*firefox");
$this->setBrowserUrl("http://www.google.com.ua/");
}

/**
* @test
* @return string
*/
public function testOne()
{
$this->open("http://www.google.com.ua/");
$title = $this->getTitle();
return $title;
}

/**
* @test
* @depends testOne
*
* @param $expectedTitle
*/
public function testTwo($expectedTitle)
{
$this->open("http://www.google.com.ua/");
$actualTitle = $this->getTitle();
$this->assertEquals($expectedTitle, $actualTitle);
}

}

result:

PHPUnit 3.6.7 by Sebastian Bergmann.

PHPUnit_Framework_Error_Warning : Missing argument 2 for PHPUnit_Framework_Error::__construct(), called in home\PEAR\PHPUnit\Extensions\SeleniumTestCase.php on line 1110 and defined
#0 home\PEAR\PHPUnit\Framework\Error.php(69): PHPUnit_Util_ErrorHandler::handleError(2, 'Missing argumen...', 'C:\wamp\bin\php...', 69, Array)
#1 home\PEAR\PHPUnit\Extensions\SeleniumTestCase.php(1110): PHPUnit_Framework_Error->__construct('Current URL: ht...')
#2 home\PEAR\PHPUnit\Framework\TestCase.php(910): PHPUnit_Extensions_SeleniumTestCase->onNotSuccessfulTest(Object(PHPUnit_Framework_Error_Warning))
#3 home\PEAR\PHPUnit\Framework\TestResult.php(649): PHPUnit_Framework_TestCase->runBare()
#4 home\PEAR\PHPUnit\Extensions\SeleniumTestCase.php(561): PHPUnit_Framework_TestResult->run(Object(test))
#5 home\PEAR\PHPUnit\Framework\TestSuite.php(772): PHPUnit_Extensions_SeleniumTestCase->run(Object(PHPUnit_Framework_TestResult))
#6 home\PEAR\PHPUnit\Framework\TestSuite.php(745): PHPUnit_Framework_TestSuite->runTest(Object(test), Object(PHPUnit_Framework_TestResult))
#7 home\PEAR\PHPUnit\TextUI\TestRunner.php(325): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false)
#8 home\PEAR\PHPUnit\TextUI\Command.php(187): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#9 home\ide-phpunit.php(194): PHPUnit_TextUI_Command->run(Array, true)
#10 home\ide-phpunit.php(386): IDE_PHPUnit_TextUI_Command::main()
#11 {main}

Time: 31 seconds, Memory: 5.75Mb

FAILURES!
Tests: 2, Assertions: 0, Errors: 1.

Process finished with exit code 2