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:

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

Yii code:

  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   

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):

  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 (better):

Create a 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>  

and install composer .

If you go for a composer, then remember that you need need_once ('../ vendor / autoload.php'); in its class and that PH will be in PUnit binaries defense / vendor / bin

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -