|
|
@@ -41,8 +41,7 @@ class AppTest extends CakeTestCase {
|
|
|
public function testBuild() {
|
|
|
$old = App::path('Model');
|
|
|
$expected = array(
|
|
|
- APP . 'Model' . DS,
|
|
|
- APP . 'models' . DS
|
|
|
+ APP . 'Model' . DS
|
|
|
);
|
|
|
$this->assertEquals($expected, $old);
|
|
|
|
|
|
@@ -50,8 +49,7 @@ class AppTest extends CakeTestCase {
|
|
|
$new = App::path('Model');
|
|
|
$expected = array(
|
|
|
'/path/to/models/',
|
|
|
- APP . 'Model' . DS,
|
|
|
- APP . 'models' . DS
|
|
|
+ APP . 'Model' . DS
|
|
|
);
|
|
|
$this->assertEquals($expected, $new);
|
|
|
|
|
|
@@ -60,8 +58,7 @@ class AppTest extends CakeTestCase {
|
|
|
$new = App::path('Model');
|
|
|
$expected = array(
|
|
|
'/path/to/models/',
|
|
|
- APP . 'Model' . DS,
|
|
|
- APP . 'models' . DS
|
|
|
+ APP . 'Model' . DS
|
|
|
);
|
|
|
$this->assertEquals($expected, $new);
|
|
|
|
|
|
@@ -70,7 +67,6 @@ class AppTest extends CakeTestCase {
|
|
|
$new = App::path('Model');
|
|
|
$expected = array(
|
|
|
APP . 'Model' . DS,
|
|
|
- APP . 'models' . DS,
|
|
|
'/path/to/models/'
|
|
|
);
|
|
|
$this->assertEquals($expected, $new);
|
|
|
@@ -83,14 +79,12 @@ class AppTest extends CakeTestCase {
|
|
|
$new = App::path('Model');
|
|
|
$expected = array(
|
|
|
APP . 'Model' . DS,
|
|
|
- APP . 'models' . DS,
|
|
|
'/path/to/models/'
|
|
|
);
|
|
|
$this->assertEquals($expected, $new);
|
|
|
$new = App::path('Controller');
|
|
|
$expected = array(
|
|
|
APP . 'Controller' . DS,
|
|
|
- APP . 'controllers' . DS,
|
|
|
'/path/to/controllers/'
|
|
|
);
|
|
|
$this->assertEquals($expected, $new);
|
|
|
@@ -108,8 +102,7 @@ class AppTest extends CakeTestCase {
|
|
|
public function testCompatibleBuild() {
|
|
|
$old = App::path('models');
|
|
|
$expected = array(
|
|
|
- APP . 'Model' . DS,
|
|
|
- APP . 'models' . DS
|
|
|
+ APP . 'Model' . DS
|
|
|
);
|
|
|
$this->assertEquals($expected, $old);
|
|
|
|
|
|
@@ -119,8 +112,7 @@ class AppTest extends CakeTestCase {
|
|
|
|
|
|
$expected = array(
|
|
|
'/path/to/models/',
|
|
|
- APP . 'Model' . DS,
|
|
|
- APP . 'models' . DS
|
|
|
+ APP . 'Model' . DS
|
|
|
);
|
|
|
$this->assertEquals($expected, $new);
|
|
|
$this->assertEquals($expected, App::path('Model'));
|
|
|
@@ -128,8 +120,7 @@ class AppTest extends CakeTestCase {
|
|
|
App::build(array('datasources' => array('/path/to/datasources/')));
|
|
|
$expected = array(
|
|
|
'/path/to/datasources/',
|
|
|
- APP . 'Model' . DS . 'Datasource' . DS,
|
|
|
- APP . 'models' . DS . 'datasources' . DS
|
|
|
+ APP . 'Model' . DS . 'Datasource' . DS
|
|
|
);
|
|
|
$result = App::path('datasources');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
@@ -138,8 +129,7 @@ class AppTest extends CakeTestCase {
|
|
|
App::build(array('behaviors' => array('/path/to/behaviors/')));
|
|
|
$expected = array(
|
|
|
'/path/to/behaviors/',
|
|
|
- APP . 'Model' . DS . 'Behavior' . DS,
|
|
|
- APP . 'models' . DS . 'behaviors' . DS
|
|
|
+ APP . 'Model' . DS . 'Behavior' . DS
|
|
|
);
|
|
|
$result = App::path('behaviors');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
@@ -148,8 +138,7 @@ class AppTest extends CakeTestCase {
|
|
|
App::build(array('controllers' => array('/path/to/controllers/')));
|
|
|
$expected = array(
|
|
|
'/path/to/controllers/',
|
|
|
- APP . 'Controller' . DS,
|
|
|
- APP . 'controllers' . DS
|
|
|
+ APP . 'Controller' . DS
|
|
|
);
|
|
|
$result = App::path('controllers');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
@@ -158,8 +147,7 @@ class AppTest extends CakeTestCase {
|
|
|
App::build(array('components' => array('/path/to/components/')));
|
|
|
$expected = array(
|
|
|
'/path/to/components/',
|
|
|
- APP . 'Controller' . DS . 'Component' . DS,
|
|
|
- APP . 'controllers' . DS . 'components' . DS
|
|
|
+ APP . 'Controller' . DS . 'Component' . DS
|
|
|
);
|
|
|
$result = App::path('components');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
@@ -168,8 +156,7 @@ class AppTest extends CakeTestCase {
|
|
|
App::build(array('views' => array('/path/to/views/')));
|
|
|
$expected = array(
|
|
|
'/path/to/views/',
|
|
|
- APP . 'View' . DS,
|
|
|
- APP . 'views' . DS
|
|
|
+ APP . 'View' . DS
|
|
|
);
|
|
|
$result = App::path('views');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
@@ -178,8 +165,7 @@ class AppTest extends CakeTestCase {
|
|
|
App::build(array('helpers' => array('/path/to/helpers/')));
|
|
|
$expected = array(
|
|
|
'/path/to/helpers/',
|
|
|
- APP . 'View' . DS . 'Helper' .DS,
|
|
|
- APP . 'views' . DS . 'helpers' . DS
|
|
|
+ APP . 'View' . DS . 'Helper' .DS
|
|
|
);
|
|
|
$result = App::path('helpers');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
@@ -188,8 +174,7 @@ class AppTest extends CakeTestCase {
|
|
|
App::build(array('shells' => array('/path/to/shells/')));
|
|
|
$expected = array(
|
|
|
'/path/to/shells/',
|
|
|
- APP . 'Console' . DS . 'Command' . DS,
|
|
|
- APP . 'console' . DS . 'shells' . DS,
|
|
|
+ APP . 'Console' . DS . 'Command' . DS
|
|
|
);
|
|
|
$result = App::path('shells');
|
|
|
$this->assertEquals($expected, $result);
|
|
|
@@ -249,8 +234,7 @@ class AppTest extends CakeTestCase {
|
|
|
public function testBuildWithReset() {
|
|
|
$old = App::path('Model');
|
|
|
$expected = array(
|
|
|
- APP . 'Model' . DS,
|
|
|
- APP . 'models' . DS
|
|
|
+ APP . 'Model' . DS
|
|
|
);
|
|
|
$this->assertEquals($expected, $old);
|
|
|
|
|
|
@@ -394,9 +378,9 @@ class AppTest extends CakeTestCase {
|
|
|
$this->assertTrue(in_array('TestPluginPost', $result));
|
|
|
|
|
|
$result = App::objects('TestPlugin.behavior');
|
|
|
- $this->assertTrue(in_array('TestPluginPersisterOne', $result));
|
|
|
+ $this->assertTrue(in_array('TestPluginPersisterOneBehavior', $result));
|
|
|
$result = App::objects('TestPlugin.Model/Behavior');
|
|
|
- $this->assertTrue(in_array('TestPluginPersisterOne', $result));
|
|
|
+ $this->assertTrue(in_array('TestPluginPersisterOneBehavior', $result));
|
|
|
|
|
|
$result = App::objects('TestPlugin.helper');
|
|
|
$expected = array('OtherHelperHelper', 'PluggedHelperHelper', 'TestPluginAppHelper');
|
|
|
@@ -553,8 +537,8 @@ class AppTest extends CakeTestCase {
|
|
|
*/
|
|
|
public function testPluginImporting() {
|
|
|
App::build(array(
|
|
|
- 'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
|
|
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
|
|
+ 'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
|
|
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
|
|
));
|
|
|
CakePlugin::loadAll();
|
|
|
|