Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.4

Bug #19152 @depends not working with PHPUnit_Extensions_SeleniumTestCase
Submitted: 2011-12-21 15:14 UTC
From: mattyp60 Assigned:
Status: Open Package: Testing_Selenium (version 0.4.4)
PHP Version: 5.3.8 OS: Windows
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 28 + 15 = ?

 
 [2011-12-21 15:14 UTC] mattyp60 (Matt Pike)
Description: ------------ The @depends annotation (http://www.phpunit.de/manual/3.6/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.test-dependencies) does not work on test cases when extending from PHPUnit_Extensions_SeleniumTestCase despite it inheriting from PHPUnit_Framework_TestCase where it does work. Test script: --------------- <?php class DependsTest extends PHPUnit_Extensions_SeleniumTestCase{ public function setUp(){ $this->setBrowser('*firefox'); $this->setBrowserUrl('http://www.google.com'); } public function testBanana(){ $this->assertTrue(true); return "banana"; } /** * @depends testBanana */ public function testPineapple($food){ $this->assertEquals("banana", $food); } } Expected result: ---------------- The return value of the test method that the @depends annotation is pointing to should be passed in as a parameter to the dependent test. Actual result: -------------- No value is passed leading to the error: "DependsTest::testPineapple Missing argument 1 for DependsTest::testPineapple()"

Comments

 [2011-12-21 19:08 UTC] mattyp60 (Matt Pike)
I should also add my version of PHPUnit is 3.5.15
 [2011-12-22 11:32 UTC] doconnor (Daniel O'Connor)
This... sort of sounds more a phpunit defect/oversight than strictly a testing_selenium one, but I'll pester Sebastian.
 [2011-12-22 15:13 UTC] mattyp60 (Matt Pike)
I also tried having an intermediate class when testing depends directly from PHPUnit_Framework_TestCase and this works perfectly fine (example below), so I think it must be something to do with the Selenium class. class IntermediateTest extends PHPUnit_Framework_TestCase{ } class DependsTest extends IntermediateTest{ public function testBanana(){ $this->assertTrue(true); return "banana"; } /** * @depends testBanana */ public function testPineapple($food){ $this->assertEquals("banana", $food); } }