浏览代码

Simplify test namespacing

Mark Scherer 11 年之前
父节点
当前提交
087c0945c2
共有 3 个文件被更改,包括 3 次插入9 次删除
  1. 2 1
      composer.json
  2. 1 1
      tests/TestCase/Model/Behavior/ConfirmableBehaviorTest.php
  3. 0 7
      tests/bootstrap.php

+ 2 - 1
composer.json

@@ -27,7 +27,8 @@
 	"autoload-dev": {
 		"psr-4": {
 			"Tools\\Test\\": "tests",
-			"Cake\\Test\\": "vendor/cakephp/cakephp/tests"
+			"Cake\\Test\\": "vendor/cakephp/cakephp/tests",
+			"TestApp\\": "tests/TestApp"
 		}
 	},
 	"support":{

+ 1 - 1
tests/TestCase/Model/Behavior/ConfirmableBehaviorTest.php

@@ -99,7 +99,7 @@ class ConfirmableBehaviorTest extends TestCase {
 			'name' => 'FooBar'
 		);
 		$animal = $this->Articles->patchEntity($animal, $data);
-		$this->assertSame(array('confirm' => array('This field is required')), $animal->errors());
+		$this->assertSame(array('confirm' => array('_required' => 'This field is required')), $animal->errors());
 	}
 
 }

+ 0 - 7
tests/bootstrap.php

@@ -26,13 +26,6 @@ ini_set('intl.default_locale', 'de-DE');
 require ROOT . '/vendor/cakephp/cakephp/src/basics.php';
 require ROOT . '/vendor/autoload.php';
 
-require CAKE . 'Core/ClassLoader.php';
-
-$loader = new Cake\Core\ClassLoader;
-$loader->register();
-
-$loader->addNamespace('TestApp', ROOT . DS . 'tests' . DS . 'TestApp' . DS);
-
 Cake\Core\Configure::write('App', [
 		'namespace' => 'App',
 		'encoding' => 'UTF-8']);