Merge pull request #20809 from totten/master-fwd
[civicrm-core.git] / tools / scripts / phpunit-ls
index 6d6ffc2076dc7a460351b98629e68d162da81fa4..0e5ff4bb5a8167750841e3eb486cbf4ffa0ee7ce 100755 (executable)
@@ -1,5 +1,19 @@
 #!/usr/bin/env php
 <?php
+
 require_once dirname(dirname(__DIR__)) . '/tests/phpunit/CiviTest/bootstrap.php';
 error_reporting(E_ALL);
-\Civi\CiUtil\Command\LsCommand::main($argv);
\ No newline at end of file
+
+if (!class_exists('PHPUnit_Framework_TestCase')) {
+  // Oooph.  PHPUnit isn't available, and we don't really need its services,
+  // but the scanner will try to read metadata about our test-classes, and
+  // that requires having the parent-classes defined.
+
+  // Note: Use eval() to prevent IDE scanners from tripping up on this.
+  eval('
+  class PHPUnit_Framework_TestCase {}
+  class PHPUnit_Extensions_SeleniumTestCase {}
+  ');
+}
+
+\Civi\CiUtil\Command\LsCommand::main($argv);