php - Yii functional testing is not working with phpunit -
Phpunit is working properly in a basic project but when I try to use it in yii functional testing I get the error: PHP fatal error: Call to undefined method PHPUnit_Framework_Warning :: setupSpecificBrowser () in ~ / phpunit / vendor / phpunit / phpunit-selenium / PHPUnit / extensions / selenium Brasorssait page line 95 Install Profit using the Compiler Version: Sebastien Bar Movement by PHPUnit 4.0.17. Selenium Version: 2.41.0 I like this runs Selenium: Java-whirl selenium-server standalone -2.41.0. Jar I do test runs Category: ~ / phpunit / vendor / bin / phpunit functional / sitesth.php In basic project code: Yii code: CWebTestCase category also It depends on the version of PHPUnit. I know that Yii 1.1.x has problems with the latest versions of PHPUnit and you have to install an old one. You can do it in two ways: Pearl (excluded): Composer (better): Create a and install If you go for a composer, then remember that you need
class WebTest is extracted PHPUnit_Extensions_Selenium2TestCase {Secure Function Setup () {$ this- & gt; Set browser ('firefox'); $ This- & gt; setBrowserUrl ('http://www.example.com/'); } Public function testTitle () {$ this- & gt; Url ('http://www.example.com/'); $ This- & gt; Emphasizing Avelles ('title string', $ --- (title)); }}
expand the class WebTestCase CWebTestCase {secure function set up () {parent: setup}; $ This- & gt; setBrowserUrl (Yii :: app () - & gt; parameter ['url'] ['base']); PHPUnit_Extensions_SeleniumTestCase Category PHPUnit_Extensions_Selenium2TestCase not
sudo pear config-set auto_discover 1 sudo pear channel-discover pear.phpunit.de sudo pear install phpunit / PHPUnit-3.7.1 pseudo pier installed phpunit / DbUnit sudo pear install phpunit / PHPUnit_Selenium sudo peer installed phpunit / PHPUnit_Story sudo pear install phpunit / PHP_Invoker
composer.json file, put it with
protected :
{ "need": { "phpunit / phpunit": "3.7.x-dev" "phpunit / dbunit": "1.3" Dev-master "," phpunit / php-invoker ":" dev-master "}} < Dev-master "," dev-master "," phpunit / phpunit-story ":" dev-master "," phpunit / phpunit-sel " Run enium "/ code>
composer .
need_once ('../ vendor / autoload.php'); in its class and that PH will be in PUnit binaries
defense / vendor / bin
Comments
Post a Comment