ソースを参照

Move test code autoloading to use composer.

No need to do this autoloading ourselves when composer can do it for us.
Mark Story 11 年 前
コミット
b8d6973764
2 ファイル変更6 行追加12 行削除
  1. 6 1
      composer.json
  2. 0 11
      tests/bootstrap.php

+ 6 - 1
composer.json

@@ -41,7 +41,12 @@
 	},
 	"autoload-dev": {
 		"psr-4": {
-			"Cake\\Test\\": "tests"
+			"Cake\\Test\\": "tests",
+			"TestApp\\": "tests/test_app/TestApp",
+			"TestPlugin\\": "tests/test_app/Plugin/TestPlugin/src",
+			"TestPlugin\\Test\\": "tests/test_app/Plugin/TestPlugin/tests",
+			"TestPluginTwo\\": "tests/test_app/Plugin/TestPluginTwo/src",
+			"PluginJs\\": "tests/test_app/Plugin/PluginJs/src"
 		}
 	},
 	"replace": {

+ 0 - 11
tests/bootstrap.php

@@ -50,17 +50,6 @@ define('CONFIG', TEST_APP . 'config' . DS);
 @mkdir(CACHE . 'models');
 //@codingStandardsIgnoreEnd
 
-require CAKE . 'Core/ClassLoader.php';
-
-$loader = new Cake\Core\ClassLoader;
-$loader->register();
-
-$loader->addNamespace('TestApp', APP);
-$loader->addNamespace('TestPlugin', TEST_APP . 'Plugin' . DS . 'TestPlugin' . DS . 'src');
-$loader->addNamespace('TestPlugin\Test', TEST_APP . 'Plugin' . DS . 'TestPlugin' . DS . 'tests');
-$loader->addNamespace('TestPluginTwo', TEST_APP . 'Plugin' . DS . 'TestPluginTwo' . DS . 'src');
-$loader->addNamespace('PluginJs', TEST_APP . 'Plugin' . DS . 'PluginJs' . DS . 'src');
-
 require_once CORE_PATH . 'config/bootstrap.php';
 
 date_default_timezone_set('UTC');