From 3e80ffc653a43aa09f64b275e86540b0bc556e06 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 13 Dec 2016 16:11:33 -0800 Subject: [PATCH] tools/scripts/phpunit-ls - Fix PhpStorm lookup of PHPUnit_Framework_TestCase When using PhpStorm, code completion doesn't work smoothly on classes which extend `PHPUnit_Framework_TestCase` because there are two copies: the real copy and then a placeholder class used by `tools/scripts/phpunit-ls`. Wrapping the placeholder copy in `eval()` prevents PhpStorm from identifying. --- tools/scripts/phpunit-ls | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/scripts/phpunit-ls b/tools/scripts/phpunit-ls index cc617906a8..fef0efc1b9 100755 --- a/tools/scripts/phpunit-ls +++ b/tools/scripts/phpunit-ls @@ -9,9 +9,12 @@ if (!class_exists('PHPUnit_Framework_TestCase')) { // 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_Database_TestCase {} class PHPUnit_Extensions_SeleniumTestCase {} + \'); } \Civi\CiUtil\Command\LsCommand::main($argv); \ No newline at end of file -- 2.25.1