FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19152&edit=1

ID: 19152
Updated by: matt.pike@nepton.fi
Reported By: matt dot pike at nepton dot fi
Summary: @depends not working with
PHPUnit_Extensions_SeleniumTestCase
Status: Open
Type: Bug
Package: Testing_Selenium
Operating System: Windows
Package Version: 0.4.4
PHP Version: 5.3.8
Roadmap Versions:
New Comment:

I should also add my version of PHPUnit is 3.5.15


Previous Comments:
------------------------------------------------------------------------

[2011-12-21 10:14:32] mattyp60

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()"

------------------------------------------------------------------------

Search Discussions

  • Daniel Oconnor at Dec 22, 2011 at 5:32 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19152&edit=1

    ID: 19152
    Updated by: daniel.oconnor@gmail.com
    Reported By: matt dot pike at nepton dot fi
    Summary: @depends not working with
    PHPUnit_Extensions_SeleniumTestCase
    Status: Open
    Type: Bug
    Package: Testing_Selenium
    Operating System: Windows
    Package Version: 0.4.4
    PHP Version: 5.3.8
    Roadmap Versions:
    New Comment:

    This... sort of sounds more a phpunit defect/oversight than strictly a
    testing_selenium
    one, but I'll pester Sebastian.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-12-21 14:08:59] mattyp60

    I should also add my version of PHPUnit is 3.5.15

    ------------------------------------------------------------------------

    [2011-12-21 10:14:32] mattyp60

    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()"

    ------------------------------------------------------------------------
  • Matt Pike at Dec 22, 2011 at 9:13 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19152&edit=1

    ID: 19152
    Comment by: matt.pike@nepton.fi
    Reported By: matt dot pike at nepton dot fi
    Summary: @depends not working with
    PHPUnit_Extensions_SeleniumTestCase
    Status: Open
    Type: Bug
    Package: Testing_Selenium
    Operating System: Windows
    Package Version: 0.4.4
    PHP Version: 5.3.8
    Roadmap Versions:
    New Comment:

    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);
    }
    }


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-12-22 06:32:17] doconnor

    This... sort of sounds more a phpunit defect/oversight than strictly a
    testing_selenium
    one, but I'll pester Sebastian.

    ------------------------------------------------------------------------

    [2011-12-21 14:08:59] mattyp60

    I should also add my version of PHPUnit is 3.5.15

    ------------------------------------------------------------------------

    [2011-12-21 10:14:32] mattyp60

    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()"

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedDec 21, '11 at 1:08p
activeDec 22, '11 at 9:13a
posts3
users3
websitepear.php.net

People

Translate

site design / logo © 2021 Grokbase