CRM-17860 - tools/scripts/phpunit - Fix for 'Civi\Foo\Bar'
[civicrm-core.git] / tools / scripts / phpunit
index d41a2f0c367b12531b30ed876c62e8255b19c82e..72e46ef00c0c4f211260b5fba69d543209664797 100755 (executable)
@@ -30,9 +30,12 @@ array_shift($argv);
 
 // Convert class names to file names
 foreach ($argv as $k => $v) {
-  if (preg_match('/^(CRM_|api_v3|_Civi_|WebTest_)/', $v)) {
+  if (preg_match('/^(CRM_|api_v3|WebTest_)/', $v)) {
     $argv[$k] = 'tests/phpunit/' . strtr($v, '_', '/') . '.php';
   }
+  elseif (preg_match('/^Civi\\\\/', $v)) {
+    $argv[$k] = 'tests/phpunit/' . strtr($v, '\\', '/') . '.php';
+  }
 }
 
 // Transition: Make sure we use phpunit code from PATH, not