Using PHPUnit test groups?

Hi all, today we would like to show you how you can use PHPUnit test groups in NetBeans. First of all, you need to enable test groups for your PHP project:


PhpUnit test groups in project properties


Then, define any number of groups suitable for your unit tests:


Define PhpUnit test groups


If you are ready, you can run your tests. A dialog allowing which test groups to run appears:


Select PhpUnit test groups to be run


Of course, only tests for selected test groups are run and displayed:


Test results


That's all for today, as always, please test it and report all the issues or enhancements you find in NetBeans BugZilla (component php, subcomponent PHPUnit).

Comments:

It looks great!

Posted by guest on September 01, 2011 at 10:33 AM CEST #

Wow, you're on fire! Love the frequent updates :)

Posted by rafa on September 01, 2011 at 06:44 PM CEST #

Really neat! Looks like a little extra thingie on top of all, but these are the kind of things that makes Netbeans so shiny

Posted by guest on September 02, 2011 at 04:43 AM CEST #

I'd like to see an example about how to test files(php) that use
require_once $_SERVER['DOCUMENT_ROOT']."/path/myFile.php";

cheers

Posted by guest on September 22, 2011 at 09:04 PM CEST #

@guest:

You should perhaps use relative paths, not absolute ones.

Posted by Tomas Mysik on September 23, 2011 at 01:12 AM CEST #

Thanks for the response!!
Do you mean refactoring myFile.php in order to make myFileTest.php works? O.O

I tried

include("myFile.php"); //relative path and
require_once $path1."/path2/myFile.php"; and nothing works :S

cheers

Posted by guest on September 23, 2011 at 02:03 PM CEST #

Thanks for the response!!
Do you mean refactoring myFile.php in order to make myFileTest.php works? O.O

I tried

include("myFile.php"); //relative path and
require_once $path1."/path2/myFile.php"; and nothing works :S

cheers

Posted by guest on September 23, 2011 at 02:37 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today