Yii Framework Forum: wamp netbeans phpunit Selenium yii - Yii Framework Forum

Jump to content

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

wamp netbeans phpunit Selenium yii how i finaly got it to work Rate Topic: -----

#1 User is offline   axmed 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 10-January 11

Posted 10 January 2011 - 05:34 PM

hi
am new to YII coming from codeigniter, never used phpunit and struggled to get it to work after much searching i got it to work, and figured to share it with others, hope it helps.

************** Downloads **************

  • netbeans(6.9.1)
  • Yii( 1.1.5)
  • WampServer(2.1-x64)


note: i don't use pear so i manually will install phpunit

I downloaded the fallowing files from http://pear.phpunit.de/

  • phpunit (3.5.7)
  • PHPUnit_Selenium (1.0.1)
  • code-coverage (1.0.3-2)
  • file-iterator (1.2.3-1)
  • text-template (1.1.0-1)
  • timer (1.0.0-10)
  • token-stream (1.0.1-3)
  • code-coverage (1.0.3-2)


************** Install **************

first lets define a constant to use in this tutorial
-PHP_Home is the directory of were the php.exe is on your pc.( example on mine is D:\wamp\bin\php\php5.3.4 ).

now install wamp first
then go into PHP_Home and create a folder called "includes" in this folder extract from the PHPUnit-3.5.7.tgz the folder PHPUnit.
now your PHP_Home\includes\PHPUnit-3.5.7\ should have in it the fallowing files.

  • phpunit.bat
  • phpunit.php
  • README.markdown
  • LICENSE
  • ChangeLog.markdown
  • PHPUnit\


now for the dependencies we need to extract in the PHP_Home\includes\PHPUnit-3.5.7\:
from the file-iterator the File folder and its content.
from the text-template the Text folder and its content.
from the timer the PHP folder and its content "timer.php".
from the code-coverage the php folder and its content
from the token-stream the PHP folder and its content "token.php and token folder"

note: don't override any files

so now the PHP_Home\includes\PHPUnit-3.5.7\ should have in it the fallowing folders:
  • phpunit.bat
  • phpunit.php
  • README.markdown
  • LICENSE
  • ChangeLog.markdown
  • PHPUnit\
  • File\
  • PHP\
  • Text\


for the last dependencies extract form the PHPUnit_Selenium.tar the folders SeleniumTestCase and story and the file SeleniumTestCase.php to the directory PHP_Home\includes\PHPUnit-3.5.7\PHPUnit\Extensions.

now copy the phpunit.bat from PHP_Home\includes\PHPUnit-3.5.7\ and place it in PHP_Home with the php.exe.
now fix windows environment variables edit the "path" and add to it ;PHP_Home so you can run the phpunit.bat from command promote.

************** editing **************

1-the phpunit.bat that we copied to PHP_Home open it with an editor and type in it this
note:use your own install directory

@echo off
D:\wamp\bin\php\php5.3.4\php.exe  -d safe_mode=Off "D:\wamp\bin\php\php5.3.4\includes\PHPUnit-3.5.7\phpunit.php" %*



2-the phpunit.php in the directory PHP_Home\includes\PHPUnit-3.5.7\

open it with an editor and change the @php_bin@ with the directory were the php.exe is example i typed "if (strpos('D:\wamp\bin\php\php5.3.4\php.exe', '@php_bin') === 0)"

3-the php.ini the one in the PHP_Home open it with an editor and change it use your directory and dont forget to remove the semicolon

; Windows: "\path1;\path2"
include_path = ".;D:\wamp\bin\php\php5.3.4\includes\PHPUnit-3.5.7"
;

note:left click the wamp icon in the system tray and in the php\php.ini file do the same thing

************** Install **************

a ) install Yii by extracting the content of yii-1.1.5.r2654.zip into D:\wamp\www\ then i add to the windows environment variables "path" the location of yic.bat example "; D:\wamp\www\yii-1.1.5.r2654\framework" then i can run yic from the command promote to create a a new site i cd in the command promote to D:\wamp\www\ and then type yiic webapp demo

b ) install netbeans then fallow the directions from netbeans_and_yii written by Marcovtwout

i hope i did not forget anything. its been just one day that am using Yii and phpunit, am not sure if this is the correct way of doing it but its working for me.
3

#2 User is offline   9981 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 23-February 11

Posted 08 May 2011 - 08:26 AM

good post. thanks for sharing.
0

#3 User is offline   za_al 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 06-March 12

Posted 12 March 2012 - 07:22 AM

very goooooood post.tanks. :rolleyes:
0

#4 User is offline   kicoe 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 25-September 12

Posted 25 September 2012 - 09:50 AM

If I may add something to this life saving post I just used, with new versions of phpunit or something, I had to install MockObject following these steps :

- Download PHPUnit_MockObject from pear
- Extracting PHPUnit_MockObject-1.2.0
- Find within it the Folder PHPUnit\Framework\MockObject
- Copy the MockObject folder
- Past it, in this case, in PHP_Home\includes\PHPUnit-3.5.7\PHPUnit\Framework

Hope it helps. If it does not, at least I tried to participate :)
0

#5 User is offline   Trejder 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,197
  • Joined: 06-October 10
  • Location:Southern Poland

Posted 10 October 2012 - 03:26 AM

@axmed, @kicoe: Your contribution like this is always welcome and thank you very much for your effort on adding this to Yii comunity.

Try to get more posts (ten or so, if I'm not mistaken), so you will be able to convert this posts to full wiki articles.

I found axmed's solution personally very good, since it uses manual PHPUnit installation. It was always big problem for me as automated instalation via PEAR always seemd to be failing for me.

Thanks again for all!
Proud Cookbook author, though still learning powerful Yii! :] See my generic profile for more information. Cheers!
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