Yii Framework Forum: PHPunit tests cases in Netbeans for an Yii web application - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

PHPunit tests cases in Netbeans for an Yii web application Rate Topic: -----

#1 User is offline   abajja 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 106
  • Joined: 05-March 09
  • Location:Barcelona, Spain

Posted 13 March 2009 - 04:48 AM

How to create PHPunit tests cases in Netbeans for an Yii web application

Environment
  Product Version: NetBeans IDE Dev (Build 200903111543)
  Java: 1.6.0_10; Java HotSpot™ Client VM 11.0-b15
  System: Windows XP version 5.1 running on x86; Cp1252; es_ES (nb)
  Apache 2.2.6 / PHP 5.2.4
  Yii framework 1.0.3
  PHPunit test 3.3.15

1. Create a web application project with yiic tools (e.g. yii-1.0.3.r780\framework>yiic webapp ../../testdrive2). Run the project to see that it works.
2. Create a netbeans php project from the source code obtained (File>New Project>Categories:PHP>Projects: PHP Application with Existing Sources). Run the project to see that it works.
3. Make sure that your Yii framework is added to your PHP Include Path
4. Create a directory for your tests at the same level of protected directory.
5. Copy, to your tests directory, these attached files TestApplication.php, TestWebApplication.php, yii.php.
6. As SiteController.php extends CController, add to SiteController.php this line:
require_once 'yii.php';

7. Right clic SiteController.php and select Tools>Create PHPunit tests.
8. Remove from SiteController.php this line added in Step 6 :
require_once 'yii.php';

9. In SiteControllerTest setUp(), comment as
//$this->object = new SiteController;
or change this line to
$this->object = new SiteController('site');

10. Add this test
testHello() {$this->assertEquals('Hello', 'Hello');}

11. Right click SiteController.php and select Test (or Ctrl+F6). that's all.

Attached File(s)

  • Attached File  yii.php (617bytes)
    Number of downloads: 10

0

#2 User is offline   abajja 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 106
  • Joined: 05-March 09
  • Location:Barcelona, Spain

Posted 13 March 2009 - 04:54 AM

TestWebApplication.php

Attached File(s)


0

#3 User is offline   abajja 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 106
  • Joined: 05-March 09
  • Location:Barcelona, Spain

Posted 13 March 2009 - 04:55 AM

TestApplication.php

Attached File(s)


0

#4 User is offline   Bergtroll 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 20-August 09

Posted 02 January 2010 - 02:27 PM

Unfortunately I am not able to download the files. Any possibility to fix it?

best regards and thx,
Bergtroll
0

#5 User is offline   badbinary 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 12-September 10

Posted 12 September 2010 - 04:12 AM

I also cannot download the file.
someone help.
0

#6 User is offline   alfonso 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 06-September 10

Posted 13 January 2011 - 02:12 PM

No funciona la descarga de ninguno de los tres archivos adjuntos, podrías volver a adjuntarlos.
Un saludo y gracias.
0

#7 User is offline   abajja 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 106
  • Joined: 05-March 09
  • Location:Barcelona, Spain

Posted 14 January 2011 - 06:23 AM

View Postalfonso, on 13 January 2011 - 02:12 PM, said:

No funciona la descarga de ninguno de los tres archivos adjuntos, podrías volver a adjuntarlos.
Un saludo y gracias.


Ya no son necesarios. ¿Qué problemas tienes?
También puedes ver estas referencias:
http://www.yiiframew...hpunit-and-yii/
http://www.yiiframew...d-yii-projects/
http://www.yiiframew...en-development/
0

#8 User is offline   Chaperone 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 27-June 11
  • Location:Batangas City, Philippines

Posted 28 June 2011 - 03:35 AM

the links are broken...
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

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