Yii Framework Forum: Firefox.php faild to include in YiiBase - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Firefox.php faild to include in YiiBase Testing using Selenium Rate Topic: -----

#1 User is offline   nhutbinh_vn 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 04-April 12

Posted 04 April 2012 - 09:01 PM

Hi,

I'm trying to conduct a functional testing in Yii using Selenium. Hwoever, when I run command

phpunit functional\SiteTest.php

it display PHP warning include(SiteTest: Firefox.php); faild to open stream

I captured a screen shot with details

I Googled for hours but cannot find any solution. any help would be appreciated,

Binh Le

Attached File(s)


0

#2 User is offline   Havunen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 06-April 12

Posted 06 April 2012 - 07:16 AM

Did you ever get this working ? I'm struggling with exactly same problem
0

#3 User is offline   cr1tical 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 06-April 12

Posted 06 April 2012 - 07:31 AM

Same problem here , it's passing all tests in this example but i' curious why i get this PHP Warnings. i'm using CentOS 6.2 with php 5.3.3, with newest version of phpunit and selenium + yii 1.1.10

trying to pass through first test example in Yii Agile book

after i enter:# phpunit functional/SiteTest.php

PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /var/www/html/bg/demo/protected/tests/phpunit.xml

PHP Warning:  include(SiteTest: firefox.php): failed to open stream: No such file or directory in /var/www/html/bg/yii/framework/YiiBase.php on line 418
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/pear/PHPUnit/TextUI/Command.php:192
PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/TextUI/TestRunner.php:325
PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:705
PHP   7. method_exists() /usr/share/pear/PHPUnit/Framework/TestSuite.php:654
PHP   8. YiiBase::autoload() /usr/share/pear/PHPUnit/Framework/TestSuite.php:0
PHP Warning:  include(): Failed opening 'SiteTest: firefox.php' for inclusion (include_path='.:/var/www/html/bg/demo/protected/components:/var/www/html/bg/demo/protected/models:/usr/share/pear:/usr/share/php') in /var/www/html/bg/yii/framework/YiiBase.php on line 418
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/pear/PHPUnit/TextUI/Command.php:192
PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/TextUI/TestRunner.php:325
PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:705
PHP   7. method_exists() /usr/share/pear/PHPUnit/Framework/TestSuite.php:654
PHP   8. YiiBase::autoload() /usr/share/pear/PHPUnit/Framework/TestSuite.php:0
...PHP Warning:  include(SiteTest: firefox.php): failed to open stream: No such file or directory in /var/www/html/bg/yii/framework/YiiBase.php on line 418
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/pear/PHPUnit/TextUI/Command.php:192
PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/TextUI/TestRunner.php:325
PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:705
PHP   7. method_exists() /usr/share/pear/PHPUnit/Framework/TestSuite.php:752
PHP   8. YiiBase::autoload() /usr/share/pear/PHPUnit/Framework/TestSuite.php:0
PHP Warning:  include(): Failed opening 'SiteTest: firefox.php' for inclusion (include_path='.:/var/www/html/bg/demo/protected/components:/var/www/html/bg/demo/protected/models:/usr/share/pear:/usr/share/php') in /var/www/html/bg/yii/framework/YiiBase.php on line 418
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/pear/PHPUnit/TextUI/Command.php:192
PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/TextUI/TestRunner.php:325
PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:705
PHP   7. method_exists() /usr/share/pear/PHPUnit/Framework/TestSuite.php:752
PHP   8. YiiBase::autoload() /usr/share/pear/PHPUnit/Framework/TestSuite.php:0


Time: 26 seconds, Memory: 5.50Mb

OK (3 tests, 12 assertions)

0

#4 User is offline   Havunen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 06-April 12

Posted 06 April 2012 - 07:47 AM

I'm also doing the exercise in the book, but my setup is slight different I'm using Netbeans 7.1.1 IDE, PHPUnit 3.6.10, Yii Framework 1.1.10, Wamp 2.2, PHP 5.3.8, and Windows 8... Netbeans returns: all OK, but skipped some tests. (Actually it skipped all tests 3 / 3)...

Netbeans returns this for me:
PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from C:\wamp\www\aapelikoti\protected\tests\phpunit.xml


Warning: include(SiteTest: Firefox.php): failed to open stream: No such file or directory in C:\wamp\yii\framework\YiiBase.php on line 418

Call Stack:
    0.0002     632504   1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
    0.0073    1226776   2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
    0.0074    1227464   3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
    0.1717    7850368   4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
    0.1778    8478984   5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
    0.1779    8482360   6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
    0.1784    8483736   7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
    0.1785    8484960   8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:654
    0.1786    8485312   9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0


Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.;C:\wamp\www\aapelikoti\protected\components;C:\wamp\www\aapelikoti\protected\models;C:\wamp\bin\php\php5.3.8\pear') in C:\wamp\yii\framework\YiiBase.php on line 418

Call Stack:
    0.0002     632504   1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
    0.0073    1226776   2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
    0.0074    1227464   3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
    0.1717    7850368   4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
    0.1778    8478984   5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
    0.1779    8482360   6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
    0.1784    8483736   7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
    0.1785    8484960   8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:654
    0.1786    8485312   9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0

SSPHP Warning:  include(SiteTest: Firefox.php): failed to open stream: No such file or directory in C:\wamp\yii\framework\YiiBase.php on line 418
PHP Stack trace:
PHP   1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
PHP   4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
PHP   5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
PHP   6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP   7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP   8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:654
PHP   9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
PHP Warning:  include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.;C:\wamp\www\aapelikoti\protected\components;C:\wamp\www\aapelikoti\protected\models;C:\wamp\bin\php\php5.3.8\pear') in C:\wamp\yii\framework\YiiBase.php on line 418
PHP Stack trace:
PHP   1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
PHP   4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
PHP   5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
PHP   6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP   7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP   8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:654
PHP   9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
PHP Warning:  include(SiteTest: Firefox.php): failed to open stream: No such file or directory in C:\wamp\yii\framework\YiiBase.php on line 418
PHP Stack trace:
PHP   1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
PHP   4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
PHP   5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
PHP   6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP   7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP   8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:752
PHP   9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
PHP Warning:  include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.;C:\wamp\www\aapelikoti\protected\components;C:\wamp\www\aapelikoti\protected\models;C:\wamp\bin\php\php5.3.8\pear') in C:\wamp\yii\framework\YiiBase.php on line 418
PHP Stack trace:
PHP   1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
PHP   4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
PHP   5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
PHP   6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP   7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP   8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:752
PHP   9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
S
Warning: include(SiteTest: Firefox.php): failed to open stream: No such file or directory in C:\wamp\yii\framework\YiiBase.php on line 418

Call Stack:
    0.0002     632504   1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
    0.0073    1226776   2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
    0.0074    1227464   3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
    0.1717    7850368   4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
    0.1778    8478984   5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
    0.1779    8482360   6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
    0.1784    8483736   7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
    6.2150    8872336   8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:752
    6.2151    8872688   9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0


Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.;C:\wamp\www\aapelikoti\protected\components;C:\wamp\www\aapelikoti\protected\models;C:\wamp\bin\php\php5.3.8\pear') in C:\wamp\yii\framework\YiiBase.php on line 418

Call Stack:
    0.0002     632504   1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
    0.0073    1226776   2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
    0.0074    1227464   3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
    0.1717    7850368   4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
    0.1778    8478984   5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
    0.1779    8482360   6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
    0.1784    8483736   7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
    6.2150    8872336   8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:752
    6.2151    8872688   9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0



Time: 6 seconds, Memory: 8.75Mb

OK, but incomplete or skipped tests!
Tests: 3, Assertions: 0, Skipped: 3.


0

#5 User is offline   Havunen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 06-April 12

Posted 07 April 2012 - 07:52 AM

I solved this problem simply by uninstalling all java programs through control panel and reinstalled java SDK, then redownloaded selenium RC server moved it to Java SDK installation folder / bin and started server from cmd: java -jar selenium.jar

code was throwing error because selenium wasn't working correctly (couldn't start browser)
0

#6 User is offline   nhutbinh_vn 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 04-April 12

Posted 10 April 2012 - 12:02 AM

View PostHavunen, on 07 April 2012 - 07:52 AM, said:

I solved this problem simply by uninstalling all java programs through control panel and reinstalled java SDK, then redownloaded selenium RC server moved it to Java SDK installation folder / bin and started server from cmd: java -jar selenium.jar

code was throwing error because selenium wasn't working correctly (couldn't start browser)


Here's what I did,

- Uninstall all java programs. Reinstall Java SE Development Kit 7
- Then put it in C:\Program Files\Java\jdk1.7.0_03\bin
- Then I run cmd: java -jar selenium-server-standalone-2.20.0.jar
- But I still have the same error.

Just wondering if it's exactly what you did,
0

#7 User is offline   Ivica 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 317
  • Joined: 25-May 11

Posted 10 April 2012 - 01:13 AM

You can also try to update phpunit and selenium to recent versions, because last selenium server doesn't work with phpunit 3.5.x
Zurmo: Yii Powered Open Source CRM
zurmo.org
0

#8 User is offline   nhutbinh_vn 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 04-April 12

Posted 10 April 2012 - 07:05 PM

View PostIvica, on 10 April 2012 - 01:13 AM, said:

You can also try to update phpunit and selenium to recent versions, because last selenium server doesn't work with phpunit 3.5.x

Hi,

I currently have PHPUnit 3.6.10 (latest update) and Selenium Server 2.20.
0

#9 User is offline   Dmitriy K. 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 20-March 12

Posted 12 April 2012 - 04:17 PM

Have anyone found the solution to this one? I have the same, but with 'Google Chrome.php' instead of 'Firefox.php'
0

#10 User is offline   Dmitriy K. 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 20-March 12

Posted 12 April 2012 - 05:08 PM

Hey everyone! I've fixed this issue.

Just find the TestSuite.php file (it usually is in PEAR_DIRECTORY\PHPUnit\Framework - for my xampp server it is C:\xampp\php\PEAR\PHPUnit\Framework) and replace (for me it's on line 653)

method_exists($this->name, 'setUpBeforeClass'))

with

@method_exists($this->name, 'setUpBeforeClass'))


P.S. Tests been working before, just gave this unneeded warning information

Update:
If you get any other errors, just find, on which line in TestSuite.php the error is (usually it is method_exists function) and just add the @ sign before - of course if it is only visual issue
1

#11 User is offline   Asterisk Pound 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 18-September 10

Posted 12 April 2012 - 05:53 PM

Well Done, that fixed the warnings on my screen.

View PostDmitriy K., on 12 April 2012 - 05:08 PM, said:

Hey everyone! I've fixed this issue.

Just find the TestSuite.php file (it usually is in PEAR_DIRECTORY\PHPUnit\Framework - for my xampp server it is C:\xampp\php\PEAR\PHPUnit\Framework) and replace (for me it's on line 653)

method_exists($this->name, 'setUpBeforeClass'))

with

@method_exists($this->name, 'setUpBeforeClass'))


P.S. Tests been working before, just gave this unneeded warning information

Update:
If you get any other errors, just find, on which line in TestSuite.php the error is (usually it is method_exists function) and just add the @ sign before - of course if it is only visual issue

0

#12 User is offline   nhutbinh_vn 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 04-April 12

Posted 16 April 2012 - 09:42 PM

Thanks Dmitriy,

It works for me as well.


View PostDmitriy K., on 12 April 2012 - 05:08 PM, said:

Hey everyone! I've fixed this issue.

Just find the TestSuite.php file (it usually is in PEAR_DIRECTORY\PHPUnit\Framework - for my xampp server it is C:\xampp\php\PEAR\PHPUnit\Framework) and replace (for me it's on line 653)

method_exists($this->name, 'setUpBeforeClass'))

with

@method_exists($this->name, 'setUpBeforeClass'))


P.S. Tests been working before, just gave this unneeded warning information

Update:
If you get any other errors, just find, on which line in TestSuite.php the error is (usually it is method_exists function) and just add the @ sign before - of course if it is only visual issue

0

#13 User is offline   Adrian G 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 15-April 12

Posted 18 April 2012 - 05:42 PM

View PostDmitriy K., on 12 April 2012 - 05:08 PM, said:

Hey everyone! I've fixed this issue.

Just find the TestSuite.php file (it usually is in PEAR_DIRECTORY\PHPUnit\Framework - for my xampp server it is C:\xampp\php\PEAR\PHPUnit\Framework) and replace (for me it's on line 653)

method_exists($this->name, 'setUpBeforeClass'))

with

@method_exists($this->name, 'setUpBeforeClass'))


P.S. Tests been working before, just gave this unneeded warning information

Update:
If you get any other errors, just find, on which line in TestSuite.php the error is (usually it is method_exists function) and just add the @ sign before - of course if it is only visual issue


@ in php is an error suppression. I'd prefer to replace it with is_callable($this->name, 'setUpBeforeClass')
0

#14 User is offline   Vitalets 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 16-December 11
  • Location:Moscow / Russia

Posted 19 April 2012 - 07:01 AM

I had the same problem.
As I found it appears as of brouser configuration in phpunit.xml file.
I've commented
	<selenium>
<!--        <browser name="Internet Explorer" browser="*iexplore" />-->
<!--        <browser name="Firefox" browser="*firefox" />-->
	</selenium>


and wrote in script:

        parent::setUp();
        $this->setBrowser('*iexplore');
        $this->setBrowserUrl(TEST_BASE_URL);


and warning do not appear now.
have a look on my extensions:
EColumns - show/hide and reorder columns in gridview
GroupGridView - merge cells and make group rows in gridview
SelGridView - keep selection in gridview
1

#15 User is offline   skidz7 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 30-March 11

Posted 25 April 2012 - 12:49 PM

View PostDmitriy K., on 12 April 2012 - 05:08 PM, said:

Hey everyone! I've fixed this issue.

Just find the TestSuite.php file (it usually is in PEAR_DIRECTORY\PHPUnit\Framework - for my xampp server it is C:\xampp\php\PEAR\PHPUnit\Framework) and replace (for me it's on line 653)

method_exists($this->name, 'setUpBeforeClass'))

with

@method_exists($this->name, 'setUpBeforeClass'))


P.S. Tests been working before, just gave this unneeded warning information

Update:
If you get any other errors, just find, on which line in TestSuite.php the error is (usually it is method_exists function) and just add the @ sign before - of course if it is only visual issue


This worked for me with the latest version of Netbeans, thank you!
0

#16 User is offline   Klausch 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 26-April 12

Posted 26 April 2012 - 11:05 AM

Unfortunately, this did not solve the issue for me. I edited the TestSuite.php and also put some comments aroud the test to verify it is called:

echo "before test method exists\n";

                if ($this->testCase &&
                    @method_exists($this->name, 'setUpBeforeClass')) {
                    call_user_func(array($this->name, 'setUpBeforeClass'));
                }
echo "after test method exists\n";


And as the output shows, these statements are called but the error still shows up:

klaas@mint-desktop /var/www/websites/demo/protected/tests $ phpunit functional/SiteTest.php D
PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /var/www/websites/demo/protected/tests/phpunit.xml

before test method exists
after test method exists
before test method exists
after test method exists
SSSPHP Warning:  include(SiteTest: Firefox.php): failed to open stream: No such file or directory in /var/www/websites/yii-1.1.10.r3566/framework/YiiBase.php on line 418
PHP Warning:  include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.:/var/www/websites/demo/protected/components:/var/www/websites/demo/protected/models:/usr/share/php:/usr/share/pear') in /var/www/websites/yii-1.1.10.r3566/framework/YiiBase.php on line 418


Time: 0 seconds, Memory: 5.00Mb

OK, but incomplete or skipped tests!
Tests: 3, Assertions: 0, Skipped: 3.




Furthermore, I do not get the stacktrace message and do not see how to enable them. Is this an option of the phpunit command?
And is there another soulution to get rid of the warning messages?
Greetings, Klaus
0

#17 User is offline   jellysandwich 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 03-May 11

Posted 04 May 2012 - 12:15 AM

Worked for me. However, I needed to add the @method_exists in TWO places instead of one. Lines 654 and 752.

setUpBeforeClass and tearDownAfterClass
0

#18 User is offline   AlexeyV 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 12-June 12

Posted 12 June 2012 - 05:24 AM

Hey, guys, read the post #14 It's work excelent and IMHO it's more rightly
0

#19 User is offline   GOsha 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 09-August 10
  • Location:Europe, Belarus, Brest

Posted 01 July 2012 - 04:11 AM

Displaying of those warnings depends on php.ini settings:
  • error_reporting
  • display errors

if you don`t want to display this warnings you must set
error_reporting(E_ALL & ~E_WARNING | E_STRICT)

or
ini_set('display_errors','off');

directives in WebTestCase.php

and don`t switch off error logging to file to save && check errors
0

#20 User is offline   Fl├ívio Rocha 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 06-July 12

Posted 06 July 2012 - 10:34 AM

Post #14 sounds more correct for me. It solved my problem.

Just to complete, after changing the file phpunit.xml, change the file WebTestCase.php placing the following lines in the setUp method:

parent::setUp();
$this->setBrowser('*firefox');
$this->setBrowserUrl(TEST_BASE_URL); 


All warnings disappeared for me.
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users