X

An Oracle blog about NetBeans for PHP

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).

Join the discussion

Comments ( 7 )
  • guest Thursday, September 1, 2011

    It looks great!


  • rafa Thursday, September 1, 2011

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


  • guest Friday, September 2, 2011

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


  • guest Thursday, September 22, 2011

    I'd like to see an example about how to test files(php) that use

    require_once $_SERVER['DOCUMENT_ROOT']."/path/myFile.php";

    cheers


  • Tomas Mysik Thursday, September 22, 2011

    @guest:

    You should perhaps use relative paths, not absolute ones.


  • guest Friday, September 23, 2011

    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


  • guest Friday, September 23, 2011

    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


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services