Yii Framework Forum: Chapter 3 - functional test does not work - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Chapter 3 - functional test does not work

#1 User is offline   Moe94 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 14-February 12

Posted 09 March 2012 - 04:46 AM

Hi!

I am not quite familiar with Yii and that's why I am just trying to work through this book. But right now, I really cannot find any solution for my issue.

So, I installed PHPUnit correctly. Then I started the Selenium Server.

C:\>java -jar selenium.jar
09.03.2012 10:23:01 org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
10:23:03.288 INFO - Java: Sun Microsystems Inc. 20.6-b01
10:23:03.314 INFO - OS: Windows 7 6.1 x86
10:23:03.408 INFO - v2.19.0, with Core v2.19.0. Built from revision 15849
10:23:04.048 INFO - RemoteWebDriver instances should connect to: wd/hub
10:23:04.050 INFO - Version Jetty/5.1.x
10:23:04.063 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
10:23:04.065 INFO - Started HttpContext[/selenium-server,/selenium-server]
10:23:04.065 INFO - Started HttpContext[/,/]
10:23:04.195 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@471e30

10:23:04.195 INFO - Started HttpContext[/wd,/wd]
10:23:04.200 INFO - Started SocketListener on 0.0.0.0:4444
10:23:04.200 INFO - Started org.openqa.jetty.jetty.Server@1ed2ae8



It also seems to work properly. However, when I tried to invoke the test, it gives me this error message back:

C:\wamp\www\test1\protected\tests>phpunit functional/SiteTest.php

Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to open s
tream: No such file or directory in C:\wamp\www\yii\framework\test\CWebTestCase.
php on line 11

Fatal error: require_once(): Failed opening required 'PHPUnit/Extensions/Seleniu
mTestCase.php' (include_path='.;C:\xampplite\php\PEAR') in C:\wamp\www\yii\frame
work\test\CWebTestCase.php on line 11

C:\wamp\www\test1\protected\tests>


I really do not know, what to do now and I did "ask" google for advice. I would really appreciate your help! Thanks in advance! :)
0

#2 User is offline   kokomo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 284
  • Joined: 23-July 10

Posted 09 March 2012 - 05:02 AM

In this post they discussed the same issue like you.

Be sure that the SeleniumTestCase.php file exists in the correct folder -> if not try reinstalling PHPUnit/Selenium.

Also some information about your operating system would be useful.
0

#3 User is offline   Moe94 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 14-February 12

Posted 10 March 2012 - 11:34 AM

Thanks for your quick reply! :)

I'm working on a Windows 7 64bit system and I'm using xampplite. Is that enough information? :)

Okay, so here is what I was trying to do. First of all, I uninstalled PHPUnit. However, it's still in my directory even though I uninstalled it correctly. Is that alright? So then I wanted to reinstall PHPUnit by using PEAR. But now it says:

No releases available for package "pear.phpunit.de/PHPUnit_Selenium"
install failed


Sorry, but I've never really used PEAR. So what am I doing wrong?
0

#4 User is offline   kokomo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 284
  • Joined: 23-July 10

Posted 10 March 2012 - 11:38 AM

View PostMoe94, on 10 March 2012 - 11:34 AM, said:

No releases available for package "pear.phpunit.de/PHPUnit_Selenium"
install failed


Maybe you haven't registered the channel.

Follow the instruction on the pear.phpunit.de page.
0

#5 User is offline   Moe94 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 14-February 12

Posted 10 March 2012 - 11:43 AM

I definately did that. So that's what I've done so far:

C:\>pear channel-discover pear.phpunit.de
Channel "pear.phpunit.de" is already initialized

C:\>pear uninstall phpunit/PHPUnit
phpunit/PHPUnit not installed

C:\>pear install phpunit/PHPUnit
No releases available for package "pear.phpunit.de/PHPUnit"
install failed

C:\>pear install phpunit/PHPUnit-3.6.9
No releases available for package "pear.phpunit.de/PHPUnit"
install failed

0

#6 User is offline   Moe94 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 14-February 12

Posted 23 March 2012 - 05:58 AM

Well, I finally managed it to install PHPUnit Selenium. I just typed in:
pear install --alldeps phpunit/PHPUnit_Selenium


However, now there are several other issues. So when I now try to run the Test, the following Warning appears:

C:\xampplite\htdocs\test1\protected\tests>phpunit functional/SiteTest.php
PHP Warning:  PHP Startup: Unable to load dynamic library ';C:\xampplite\php\ext
\php_bz2.dll' - Das angegebene Modul wurde nicht gefunden.
 in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library ';C:\xampplite\php\ext\php_
bz2.dll' - Das angegebene Modul wurde nicht gefunden.
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library ';C:\xampplite\php\ext
\php_curl.dll' - Das angegebene Modul wurde nicht gefunden.
 in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library ';C:\xampplite\php\ext\php_
curl.dll' - Das angegebene Modul wurde nicht gefunden.
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library ';C:\xampplite\php\ext
\php_mbstring.dll' - Das angegebene Modul wurde nicht gefunden.
 in Unknown on line 0


Could somebody please help me? Thanks in advance! ;)

EDIT:
The extensions are in the right directory.
0

#7 User is offline   Partoo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 07-February 12

Posted 20 October 2012 - 04:11 AM

I solved this:
I use WAMP SERVER,so modify php.ini in WAMP_PATH/bin/php/php.ini and make sure 'extension=php_curl.dll' (maybe you have opened curl in wamp panel or bin/apache/php.ini,it's unuseful).
If failed yet,reinstall phpunit and selenium.
Good luck.
0

#8 User is offline   jman 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 30-April 13

Posted 30 April 2013 - 12:36 PM

I solved this on Windows7 by

1) open cmd.exe as administator. go to c:\windows\system32. right click on cmd.exe, choose run as administrator.
2) cd c:\wamp\bin\php\php5.4.3
3) pear clear-cache
4) pear install -f --alldeps phpunit/PHPUnit_Selenium


Hope this helps someone

JMan
0

#9 Guest_Yii Tutor_*

  • Group: Guests

Posted 16 May 2013 - 08:25 AM

11

View PostMoe94, on 09 March 2012 - 04:46 AM, said:

Hi!

to learn yii visit this website www.yiitutorial.com

I am not quite familiar with Yii and that's why I am just trying to work through this book. But right now, I really cannot find any solution for my issue.

So, I installed PHPUnit correctly. Then I started the Selenium Server.

C:\>java -jar selenium.jar
09.03.2012 10:23:01 org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
10:23:03.288 INFO - Java: Sun Microsystems Inc. 20.6-b01
10:23:03.314 INFO - OS: Windows 7 6.1 x86
10:23:03.408 INFO - v2.19.0, with Core v2.19.0. Built from revision 15849
10:23:04.048 INFO - RemoteWebDriver instances should connect to: wd/hub
10:23:04.050 INFO - Version Jetty/5.1.x
10:23:04.063 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
10:23:04.065 INFO - Started HttpContext[/selenium-server,/selenium-server]
10:23:04.065 INFO - Started HttpContext[/,/]
10:23:04.195 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@471e30

10:23:04.195 INFO - Started HttpContext[/wd,/wd]
10:23:04.200 INFO - Started SocketListener on 0.0.0.0:4444
10:23:04.200 INFO - Started org.openqa.jetty.jetty.Server@1ed2ae8



It also seems to work properly. However, when I tried to invoke the test, it gives me this error message back:

C:\wamp\www\test1\protected\tests>phpunit functional/SiteTest.php

Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to open s
tream: No such file or directory in C:\wamp\www\yii\framework\test\CWebTestCase.
php on line 11

Fatal error: require_once(): Failed opening required 'PHPUnit/Extensions/Seleniu
mTestCase.php' (include_path='.;C:\xampplite\php\PEAR') in C:\wamp\www\yii\frame
work\test\CWebTestCase.php on line 11

C:\wamp\www\test1\protected\tests>


I really do not know, what to do now and I did "ask" google for advice. I would really appreciate your help! Thanks in advance! :)

0

Share this topic:


Page 1 of 1
  • 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