Author: maksim_ka
Date: 2010-02-05 21:57:28 +0100 (Fri, 05 Feb 2010)
New Revision: 27609

Modified:
   plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfPhpunitSuiteLoader.class.php
Log:
[sfPhpunitPlugin][sf1.2] tests can be run from eclipse using 'run external' 
feature

Modified: 
plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfPhpunitSuiteLoader.class.php
===================================================================
--- 
plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfPhpunitSuiteLoader.class.php    
    2010-02-05 19:17:56 UTC (rev 27608)
+++ 
plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfPhpunitSuiteLoader.class.php    
    2010-02-05 20:57:28 UTC (rev 27609)
@@ -38,9 +38,17 @@
                if (empty($path) || $path[strlen($path) - 1] == '*') {
                        $path = substr($path, 0, strlen($path) - 1);
                        $this->_recursively = true;
-               } 
+               }
                
-               $root_dir = $test_dir = sfConfig::get('sf_test_dir').'/phpunit';
+               /*
+     * it is allowed us to run tests from eclipse using 'run external tool 
feature
+     * for more info read: http://www.phpunit.de/wiki/Eclipse
+     */
+         $root_dir = $test_dir = sfConfig::get('sf_test_dir').'/phpunit';
+    if (false !== strpos($path, $root_dir)) {
+      $path = str_replace($root_dir, '', $path);
+    }
+
                if (!file_exists($root_dir.'/'.$path)) {
                        throw new Exception('The path `'.$path.'` is invalid.');
                }

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