Author: FrankStelzer
Date: 2010-09-08 16:31:29 +0200 (Wed, 08 Sep 2010)
New Revision: 30856

Modified:
   plugins/sfPHPUnit2Plugin/trunk/README
   plugins/sfPHPUnit2Plugin/trunk/lib/task/sfPHPUnitTestAllTask.class.php
Log:
[sfPHPUnit2Plugin] added possibility to define custom test suites for the 
test-all task, added hints for best practices of the phpunit.xml

Modified: plugins/sfPHPUnit2Plugin/trunk/README
===================================================================
--- plugins/sfPHPUnit2Plugin/trunk/README       2010-09-08 14:25:36 UTC (rev 
30855)
+++ plugins/sfPHPUnit2Plugin/trunk/README       2010-09-08 14:31:29 UTC (rev 
30856)
@@ -217,7 +217,11 @@
 Executing all tests (process isolation option required!):
 
         $ ./symfony phpunit:test-all --options="--colors --process-isolation"
+        
+Executing all tests using custom test suites defined in the phpunit.xml(.dist):
 
+        $ ./symfony phpunit:test-all --configuration
+
 Executing a unit test within a plugin:
 
         $ # file has to be located in 
plugins/sfPHPUnit2Plugin/test/unit/fooPluginTest.php
@@ -237,7 +241,9 @@
   * You do not like the PHPUnit syntax? Use **$this->getTest()** to retrieve a 
instance of sfPHPUnitTest, which mimics the lime-like interface!
   * Use the **_start** and **_end** methods for doing something just before 
and after a test (please do not overwrite the setUp and tearDown methods)!
   * implement the **getApplication** method in your unit test and call 
**getContext** afterwards for creating an according sfContext instance
-  * add a 
***[phpunit.xml](http://www.phpunit.de/manual/3.4/en/appendixes.configuration.html)***
 in the project's root dir for defining default configuration options for 
PHPUnit calls
+  * add a 
***[phpunit.xml.dist](http://test.ical.ly/2010/08/24/best-practice-how-to-ship-phpunit-configuration/)***
 in the project's root dir for defining **default** configuration options for 
PHPUnit calls. Thanks Christian for pointing this out :)
+  * add a 
***[phpunit.xml](http://www.phpunit.de/manual/3.4/en/appendixes.configuration.html)***
 in the project's root dir for defining **individual** configuration options 
for PHPUnit calls
+  
 
         <phpunit
           colors="true"
@@ -245,6 +251,15 @@
           convertNoticesToExceptions="true"
           convertWarningsToExceptions="true"
           stopOnFailure="true">
+          
+          <testsuites>
+            <testsuite name="Unit Tests">
+              <directory>test/phpunit/unit/</directory>
+            </testsuite>
+             <testsuite name="Functional Tests">
+               <directory>test/phpunit/functional/</directory>
+            </testsuite>
+          </testsuites>
         </phpunit>
 
 

Modified: plugins/sfPHPUnit2Plugin/trunk/lib/task/sfPHPUnitTestAllTask.class.php
===================================================================
--- plugins/sfPHPUnit2Plugin/trunk/lib/task/sfPHPUnitTestAllTask.class.php      
2010-09-08 14:25:36 UTC (rev 30855)
+++ plugins/sfPHPUnit2Plugin/trunk/lib/task/sfPHPUnitTestAllTask.class.php      
2010-09-08 14:31:29 UTC (rev 30856)
@@ -28,6 +28,7 @@
 
     $this->addOptions(array(
     new sfCommandOption('options', null, sfCommandOption::PARAMETER_REQUIRED, 
'Options for PHPUnit which are directly passed to the test runner'),
+    new sfCommandOption('configuration', null, 
sfCommandOption::PARAMETER_NONE, 'Flag if default configuration of phpunit.xml 
should be used'),
     ));
 
     $this->namespace        = 'phpunit';
@@ -50,7 +51,7 @@
    */
   protected function execute($arguments = array(), $options = array())
   {
-    $cmd = 'phpunit '.$options['options'].' test/phpunit/';
+    $cmd = 'phpunit '.$options['options'].($options['configuration']? '' : ' 
test/phpunit/');
 
     passthru($cmd);
   }

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to