From fe22e83c76ac08baf4a64fbf505967dacbff4d39 Mon Sep 17 00:00:00 2001 From: Brown Date: Thu, 9 May 2019 18:58:30 -0400 Subject: [PATCH] Move config tests into separate dir --- tests/{ => Config}/ConfigFileTest.php | 4 +- tests/{ => Config}/ConfigTest.php | 67 ++++++++++--------- .../Plugin/AfterAnalysisPlugin.php | 2 +- tests/{ => Config}/Plugin/FunctionPlugin.php | 2 +- .../Plugin/Hook/AfterAnalysis.php | 2 +- .../Plugin/Hook/FooMethodProvider.php | 2 +- .../Plugin/Hook/FooPropertyProvider.php | 2 +- .../Plugin/Hook/MagicFunctionProvider.php | 2 +- tests/{ => Config}/Plugin/MethodPlugin.php | 2 +- tests/{ => Config}/Plugin/PropertyPlugin.php | 2 +- tests/{ => Config}/PluginListTest.php | 4 +- tests/{ => Config}/PluginTest.php | 65 +++++++++--------- 12 files changed, 79 insertions(+), 77 deletions(-) rename tests/{ => Config}/ConfigFileTest.php (98%) rename tests/{ => Config}/ConfigTest.php (96%) rename tests/{ => Config}/Plugin/AfterAnalysisPlugin.php (92%) rename tests/{ => Config}/Plugin/FunctionPlugin.php (92%) rename tests/{ => Config}/Plugin/Hook/AfterAnalysis.php (95%) rename tests/{ => Config}/Plugin/Hook/FooMethodProvider.php (98%) rename tests/{ => Config}/Plugin/Hook/FooPropertyProvider.php (97%) rename tests/{ => Config}/Plugin/Hook/MagicFunctionProvider.php (97%) rename tests/{ => Config}/Plugin/MethodPlugin.php (92%) rename tests/{ => Config}/Plugin/PropertyPlugin.php (92%) rename tests/{ => Config}/PluginListTest.php (98%) rename tests/{ => Config}/PluginTest.php (91%) diff --git a/tests/ConfigFileTest.php b/tests/Config/ConfigFileTest.php similarity index 98% rename from tests/ConfigFileTest.php rename to tests/Config/ConfigFileTest.php index fb0bda5cc..6f809f06f 100644 --- a/tests/ConfigFileTest.php +++ b/tests/Config/ConfigFileTest.php @@ -1,11 +1,11 @@ project_analyzer = $this->getProjectAnalyzerWithConfig( Config::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -116,7 +117,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( Config::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -141,7 +142,7 @@ class ConfigTest extends TestCase */ public function testIgnoreSymlinkedProjectDirectory() { - @unlink(__DIR__ . '/fixtures/symlinktest/ignored/b'); + @unlink(dirname(__DIR__, 1) . '/fixtures/symlinktest/ignored/b'); $no_symlinking_error = 'symlink(): Cannot create symlink, error code(1314)'; $last_error = error_get_last(); @@ -150,7 +151,7 @@ class ConfigTest extends TestCase !isset($last_error['message']) || $no_symlinking_error !== $last_error['message']; - @symlink(__DIR__ . '/fixtures/symlinktest/a', __DIR__ . '/fixtures/symlinktest/ignored/b'); + @symlink(dirname(__DIR__, 1) . '/fixtures/symlinktest/a', dirname(__DIR__, 1) . '/fixtures/symlinktest/ignored/b'); if ($check_symlink_error) { $last_error = error_get_last(); @@ -164,7 +165,7 @@ class ConfigTest extends TestCase $this->project_analyzer = $this->getProjectAnalyzerWithConfig( Config::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -214,7 +215,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( Config::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -242,7 +243,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( Config::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -270,7 +271,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( Config::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -301,7 +302,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( Config::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -332,7 +333,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( Config::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -360,7 +361,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( Config::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -569,7 +570,7 @@ class ConfigTest extends TestCase $this->project_analyzer = $this->getProjectAnalyzerWithConfig( Config::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -594,7 +595,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( Config::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -619,7 +620,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -648,7 +649,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -677,7 +678,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -725,7 +726,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -760,7 +761,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -830,7 +831,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' ' ) @@ -857,7 +858,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -888,7 +889,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' ' ) @@ -912,7 +913,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' ' ) @@ -940,7 +941,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -972,7 +973,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -1024,7 +1025,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -1073,7 +1074,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -1127,8 +1128,8 @@ class ConfigTest extends TestCase { foreach (['1.xml', '2.xml', '3.xml', '4.xml', '5.xml', '6.xml', '7.xml', '8.xml'] as $file_name) { Config::loadFromXMLFile( - realpath(dirname(__DIR__) . '/assets/config_levels/' . $file_name), - dirname(__DIR__) + realpath(dirname(__DIR__, 2) . '/assets/config_levels/' . $file_name), + dirname(__DIR__, 2) ); } } @@ -1140,7 +1141,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -1238,7 +1239,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' @@ -1285,7 +1286,7 @@ class ConfigTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__), + dirname(__DIR__, 2), ' diff --git a/tests/Plugin/AfterAnalysisPlugin.php b/tests/Config/Plugin/AfterAnalysisPlugin.php similarity index 92% rename from tests/Plugin/AfterAnalysisPlugin.php rename to tests/Config/Plugin/AfterAnalysisPlugin.php index 038ef9f8d..36db28351 100644 --- a/tests/Plugin/AfterAnalysisPlugin.php +++ b/tests/Config/Plugin/AfterAnalysisPlugin.php @@ -1,5 +1,5 @@ */ private $config_file; diff --git a/tests/PluginTest.php b/tests/Config/PluginTest.php similarity index 91% rename from tests/PluginTest.php rename to tests/Config/PluginTest.php index f11ef5852..368f58a3b 100644 --- a/tests/PluginTest.php +++ b/tests/Config/PluginTest.php @@ -1,5 +1,5 @@ project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -104,7 +105,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -144,7 +145,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -181,7 +182,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -216,7 +217,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -256,7 +257,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -292,7 +293,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -345,7 +346,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -379,7 +380,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -418,7 +419,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -449,11 +450,11 @@ class PluginTest extends TestCase /** @return void */ public function testInheritedHookHandlersAreCalled() { - require_once __DIR__ . '/fixtures/stubs/extending_plugin_entrypoint.php'; + require_once dirname(__DIR__) . '/fixtures/stubs/extending_plugin_entrypoint.php'; $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -478,7 +479,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' @@ -514,14 +515,14 @@ class PluginTest extends TestCase $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' - + ' ) @@ -552,14 +553,14 @@ class PluginTest extends TestCase $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' - + ' ) @@ -591,14 +592,14 @@ class PluginTest extends TestCase $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' - + ' ) @@ -629,14 +630,14 @@ class PluginTest extends TestCase $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' - + ' ) @@ -672,14 +673,14 @@ class PluginTest extends TestCase $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' - + ' ) @@ -715,14 +716,14 @@ class PluginTest extends TestCase $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' - + ' ) @@ -750,14 +751,14 @@ class PluginTest extends TestCase $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, ' - + ' ) @@ -778,7 +779,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, sprintf( ' @@ -789,7 +790,7 @@ class PluginTest extends TestCase ', - __DIR__.'/..' + __DIR__.'/../..' ) ) ); @@ -807,7 +808,7 @@ class PluginTest extends TestCase { $this->project_analyzer = $this->getProjectAnalyzerWithConfig( TestConfig::loadFromXML( - dirname(__DIR__) . DIRECTORY_SEPARATOR, + dirname(__DIR__, 2) . DIRECTORY_SEPARATOR, sprintf( '