Removing constant TEST_CAKE_CORE_INCLUDE_PATH

This commit is contained in:
José Lorenzo Rodríguez 2010-12-19 23:33:37 -04:30
parent 5fa028839e
commit b2ad8fe113
50 changed files with 277 additions and 278 deletions

View file

@ -72,8 +72,6 @@ if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
define('TEST_CAKE_CORE_INCLUDE_PATH', LIBS);
if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.', true));
}

View file

@ -21,7 +21,7 @@
*/
App::import('Controller', 'Controller', false);
App::import('Core', array('AppModel', 'Model'));
require_once TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'lib' . DS . 'reporter' . DS . 'cake_html_reporter.php';
require_once LIBS . 'tests' . DS . 'lib' . DS . 'reporter' . DS . 'cake_html_reporter.php';
require_once dirname(__FILE__) . DS . 'model' . DS . 'models.php';
/**
@ -108,10 +108,10 @@ class ControllerTestCaseTest extends CakeTestCase {
function setUp() {
parent::setUp();
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS),
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'controllers' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS),
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS)
));
$this->Case = new ControllerTestCase();
Router::reload();
@ -222,7 +222,7 @@ class ControllerTestCaseTest extends CakeTestCase {
* Tests using loaded routes during tests
*/
function testUseRoutes() {
include TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
include LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
$controller = $this->Case->generate('TestsApps');
$controller->Components->load('RequestHandler');
$result = $this->Case->testAction('/tests_apps/index.json', array('return' => 'view'));
@ -230,16 +230,16 @@ class ControllerTestCaseTest extends CakeTestCase {
$expected = array('cakephp' => 'cool');
$this->assertEquals($result, $expected);
include TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
include LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
$result = $this->Case->testAction('/some_alias');
$this->assertEquals($result, 5);
include TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
include LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
$this->Case->testAction('/redirect_me_now');
$result = $this->Case->headers['Location'];
$this->assertEquals($result, 'http://cakephp.org');
include TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
include LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
$this->Case->testAction('/redirect_me');
$result = $this->Case->headers['Location'];
$this->assertEquals($result, Router::url(array('controller' => 'tests_apps', 'action' => 'some_method'), true));
@ -251,7 +251,7 @@ class ControllerTestCaseTest extends CakeTestCase {
* @expectedException MissingActionException
*/
function testSkipRoutes() {
include TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
include LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
$this->Case->loadRoutes = false;

View file

@ -160,7 +160,6 @@ class TestSuiteShell extends Shell {
* @return void
*/
public function initialize() {
define('TEST_CAKE_CORE_INCLUDE_PATH', LIBS);
$this->_dispatcher = new CakeTestSuiteDispatcher();
$this->_dispatcher->loadTestFramework();
}

View file

@ -50,7 +50,7 @@ ini_set('display_errors', 1);
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT);
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS .'lib');
}
/**
@ -68,21 +68,14 @@ if (!defined('CORE_PATH')) {
define('APP_PATH', ROOT . DS . APP_DIR . DS);
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
$corePath = App::core('cake');
if (isset($corePath[0])) {
define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
} else {
define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH);
}
if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.', true));
}
require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php';
require_once CAKE_TESTS_LIB . 'CakeTestSuiteDispatcher.php';
CakeTestSuiteDispatcher::run();

View file

@ -102,7 +102,7 @@ abstract class BaseCoverageReport {
} elseif ($this->pluginTest) {
$path = App::pluginPath($this->pluginTest);
} else {
$path = TEST_CAKE_CORE_INCLUDE_PATH;
$path = LIBS;
}
return $path;
}

View file

@ -128,7 +128,7 @@ class CakeFixtureManager {
$fixturePaths = array(
TESTS . 'fixtures',
VENDORS . 'tests' . DS . 'fixtures',
TEST_CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'tests' . DS . 'fixtures'
LIBS . DS . 'cake' . DS . 'tests' . DS . 'fixtures'
);
}

View file

@ -36,7 +36,7 @@ class BasicsTest extends CakeTestCase {
*/
public function setUp() {
App::build(array(
'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
'locales' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
));
$this->_language = Configure::read('Config.language');
}

View file

@ -89,7 +89,7 @@ class TaskCollectionTest extends CakeTestCase {
$dispatcher = $this->getMock('ShellDispatcher', array(), array(), '', false);
$shell = $this->getMock('Shell', array(), array(), '', false);
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$this->Tasks = new TaskCollection($shell, $dispatcher);

View file

@ -119,11 +119,11 @@ class ShellDispatcherTest extends CakeTestCase {
parent::setUp();
App::build(array(
'plugins' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
),
'shells' => array(
CORE_PATH ? CONSOLE_LIBS : ROOT . DS . CONSOLE_LIBS,
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'console' . DS . 'shells' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'console' . DS . 'shells' . DS
)
), true);
}

View file

@ -39,13 +39,13 @@ class CommandListTest extends CakeTestCase {
parent::setUp();
App::build(array(
'plugins' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
),
'shells' => array(
CORE_PATH ?
CORE_PATH . CAKE . 'console' . DS . 'shells' . DS :
CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'shells' .DS,
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'console' . DS . 'shells' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'console' . DS . 'shells' . DS
)
), true);
App::objects('plugin', null, false);

View file

@ -187,7 +187,7 @@ class SchemaShellTest extends CakeTestCase {
*/
public function testViewWithPlugins() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$this->Shell->args = array('TestPlugin.schema');
$this->Shell->startup();
@ -236,7 +236,7 @@ class SchemaShellTest extends CakeTestCase {
*/
public function testDumpFileWritingWithPlugins() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$this->Shell->args = array('TestPlugin.TestPluginApp');
$this->Shell->params = array(
@ -332,7 +332,7 @@ class SchemaShellTest extends CakeTestCase {
*/
public function testGenerateWithPlugins() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
App::objects('plugin', null, false);
@ -445,14 +445,14 @@ class SchemaShellTest extends CakeTestCase {
*/
public function testPluginParam() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$this->Shell->params = array(
'plugin' => 'TestPlugin',
'connection' => 'test'
);
$this->Shell->startup();
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'config' . DS . 'schema';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'config' . DS . 'schema';
$this->assertEqual($this->Shell->Schema->path, $expected);
}
@ -463,7 +463,7 @@ class SchemaShellTest extends CakeTestCase {
*/
public function testPluginDotSyntaxWithCreate() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$this->Shell->params = array(
'connection' => 'test'

View file

@ -174,8 +174,8 @@ class ShellTest extends CakeTestCase {
*/
public function testInitialize() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS)
), true);
$this->Shell->uses = array('TestPlugin.TestPluginPost');

View file

@ -72,7 +72,7 @@ class ExtractTaskTest extends CakeTestCase {
public function testExecute() {
$this->Task->interactive = false;
$this->Task->params['paths'] = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages';
$this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages';
$this->Task->params['output'] = $this->path . DS;
$this->Task->expects($this->never())->method('err');
$this->Task->expects($this->any())->method('in')
@ -154,7 +154,7 @@ class ExtractTaskTest extends CakeTestCase {
function testExtractWithExclude() {
$this->Task->interactive = false;
$this->Task->params['paths'] = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views';
$this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'views';
$this->Task->params['output'] = $this->path . DS;
$this->Task->params['exclude'] = 'pages,layouts';
@ -181,8 +181,8 @@ class ExtractTaskTest extends CakeTestCase {
$this->Task->interactive = false;
$this->Task->params['paths'] =
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages,' .
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'posts';
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages,' .
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'posts';
$this->Task->params['output'] = $this->path . DS;
$this->Task->expects($this->never())->method('err');

View file

@ -126,7 +126,7 @@ class TemplateTaskTest extends CakeTestCase {
public function testGenerate() {
App::build(array(
'shells' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'console' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'console' . DS
)
));
$this->Task->initialize();
@ -146,7 +146,7 @@ class TemplateTaskTest extends CakeTestCase {
public function testGenerateWithTemplateFallbacks() {
App::build(array(
'shells' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'console' . DS,
LIBS . 'tests' . DS . 'test_app' . DS . 'console' . DS,
CAKE_CORE_INCLUDE_PATH . DS . 'console' . DS
)
));

View file

@ -94,7 +94,7 @@ class AppImportTest extends CakeTestCase {
* @return void
*/
function testListObjects() {
$result = App::objects('class', TEST_CAKE_CORE_INCLUDE_PATH . 'libs', false);
$result = App::objects('class', LIBS . 'libs', false);
$this->assertTrue(in_array('Xml', $result));
$this->assertTrue(in_array('Cache', $result));
$this->assertTrue(in_array('HttpSocket', $result));
@ -132,7 +132,7 @@ class AppImportTest extends CakeTestCase {
App::build(array(
'plugins' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS
)
));
$result = App::objects('plugin', null, false);
@ -149,18 +149,18 @@ class AppImportTest extends CakeTestCase {
*/
function testPluginPath() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$path = App::pluginPath('test_plugin');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS;
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS;
$this->assertEqual($path, $expected);
$path = App::pluginPath('TestPlugin');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS;
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS;
$this->assertEqual($path, $expected);
$path = App::pluginPath('TestPluginTwo');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin_two' . DS;
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin_two' . DS;
$this->assertEqual($path, $expected);
App::build();
}
@ -172,14 +172,14 @@ class AppImportTest extends CakeTestCase {
*/
function testThemePath() {
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS)
));
$path = App::themePath('test_theme');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS;
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS;
$this->assertEqual($path, $expected);
$path = App::themePath('TestTheme');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS;
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS;
$this->assertEqual($path, $expected);
App::build();
@ -284,8 +284,8 @@ class AppImportTest extends CakeTestCase {
*/
function testPluginImporting() {
App::build(array(
'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$result = App::import('Controller', 'TestPlugin.Tests');
@ -330,10 +330,10 @@ class AppImportTest extends CakeTestCase {
App::build(array(
'helpers' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'helpers' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'helpers' . DS
)
));
App::build(array('vendors' => array(TEST_CAKE_CORE_INCLUDE_PATH)));
App::build(array('vendors' => array(LIBS)));
$this->assertFalse(class_exists('BananaHelper'), 'BananaHelper exists, cannot test importing it.');
App::import('Helper', 'Banana');
$this->assertTrue(class_exists('BananaHelper'), 'BananaHelper was not loaded.');
@ -348,10 +348,10 @@ class AppImportTest extends CakeTestCase {
* @return void
*/
function testFileLoading () {
$file = App::import('File', 'RealFile', false, array(), TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php');
$file = App::import('File', 'RealFile', false, array(), LIBS . 'config' . DS . 'config.php');
$this->assertTrue($file);
$file = App::import('File', 'NoFile', false, array(), TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'cake' . DS . 'config.php');
$file = App::import('File', 'NoFile', false, array(), LIBS . 'config' . DS . 'cake' . DS . 'config.php');
$this->assertFalse($file);
}
@ -363,12 +363,12 @@ class AppImportTest extends CakeTestCase {
*/
function testFileLoadingWithArray() {
$type = array('type' => 'File', 'name' => 'SomeName', 'parent' => false,
'file' => TEST_CAKE_CORE_INCLUDE_PATH . DS . 'config' . DS . 'config.php');
'file' => LIBS . DS . 'config' . DS . 'config.php');
$file = App::import($type);
$this->assertTrue($file);
$type = array('type' => 'File', 'name' => 'NoFile', 'parent' => false,
'file' => TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'cake' . DS . 'config.php');
'file' => LIBS . 'config' . DS . 'cake' . DS . 'config.php');
$file = App::import($type);
$this->assertFalse($file);
}
@ -380,13 +380,13 @@ class AppImportTest extends CakeTestCase {
* @return void
*/
function testFileLoadingReturnValue () {
$file = App::import('File', 'Name', false, array(), TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php', true);
$file = App::import('File', 'Name', false, array(), LIBS . 'config' . DS . 'config.php', true);
$this->assertTrue(!empty($file));
$this->assertTrue(isset($file['Cake.version']));
$type = array('type' => 'File', 'name' => 'OtherName', 'parent' => false,
'file' => TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php', 'return' => true);
'file' => LIBS . 'config' . DS . 'config.php', 'return' => true);
$file = App::import($type);
$this->assertTrue(!empty($file));
@ -400,7 +400,7 @@ class AppImportTest extends CakeTestCase {
* @return void
*/
function testLoadingWithSearch () {
$file = App::import('File', 'NewName', false, array(TEST_CAKE_CORE_INCLUDE_PATH ), 'config.php');
$file = App::import('File', 'NewName', false, array(LIBS ), 'config.php');
$this->assertTrue($file);
$file = App::import('File', 'AnotherNewName', false, array(LIBS), 'config.php');
@ -414,7 +414,7 @@ class AppImportTest extends CakeTestCase {
* @return void
*/
function testLoadingWithSearchArray () {
$type = array('type' => 'File', 'name' => 'RandomName', 'parent' => false, 'file' => 'config.php', 'search' => array(TEST_CAKE_CORE_INCLUDE_PATH ));
$type = array('type' => 'File', 'name' => 'RandomName', 'parent' => false, 'file' => 'config.php', 'search' => array(LIBS ));
$file = App::import($type);
$this->assertTrue($file);
@ -476,8 +476,8 @@ class AppImportTest extends CakeTestCase {
*/
function testLoadingVendor() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'vendors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'vendors' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'vendors'. DS),
), true);
ob_start();

View file

@ -92,8 +92,8 @@ class CacheTest extends CakeTestCase {
*/
function testConfigWithLibAndPluginEngines() {
App::build(array(
'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
$settings = array('engine' => 'TestAppCache', 'path' => TMP, 'prefix' => 'cake_test_');
@ -260,8 +260,8 @@ class CacheTest extends CakeTestCase {
*/
function testDrop() {
App::build(array(
'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
$result = Cache::drop('some_config_that_does_not_exist');
@ -313,8 +313,8 @@ class CacheTest extends CakeTestCase {
*/
function testWriteTriggerError() {
App::build(array(
'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
Cache::config('test_trigger', array('engine' => 'TestAppCache'));

View file

@ -49,8 +49,8 @@ class CakeLogTest extends CakeTestCase {
*/
function testImportingLoggers() {
App::build(array(
'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
$result = CakeLog::config('libtest', array(

View file

@ -529,8 +529,8 @@ class CakeSessionTest extends CakeTestCase {
*/
function testUsingAppLibsHandler() {
App::build(array(
'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
Configure::write('Session', array(
'defaults' => 'cake',
@ -551,8 +551,8 @@ class CakeSessionTest extends CakeTestCase {
*/
function testUsingPluginHandler() {
App::build(array(
'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
Configure::write('Session', array(

View file

@ -35,7 +35,7 @@ class IniReaderTest extends CakeTestCase {
*/
function setup() {
parent::setup();
$this->path = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS;
$this->path = LIBS . 'tests' . DS . 'test_app' . DS . 'config'. DS;
}
/**

View file

@ -27,7 +27,7 @@ class PhpReaderTest extends CakeTestCase {
*/
function setUp() {
parent::setUp();
$this->path = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS;
$this->path = LIBS . 'tests' . DS . 'test_app' . DS . 'config'. DS;
}
/**
* test reading files
@ -81,7 +81,7 @@ class PhpReaderTest extends CakeTestCase {
*/
function testReadPluginValue() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
$reader = new PhpReader($this->path);
$result = $reader->read('TestPlugin.load');

View file

@ -200,7 +200,7 @@ class ConfigureTest extends CakeTestCase {
* @return void
*/
function testLoad() {
Configure::config('test', new PhpReader(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS));
Configure::config('test', new PhpReader(LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS));
$result = Configure::load('var_test', 'test');
$this->assertTrue($result);
@ -215,7 +215,7 @@ class ConfigureTest extends CakeTestCase {
* @return void
*/
function testLoadPlugin() {
App::build(array('plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)), true);
App::build(array('plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)), true);
Configure::config('test', new PhpReader());
$result = Configure::load('test_plugin.load', 'test');

View file

@ -53,7 +53,7 @@ class ParamTestComponent extends Component {
* @access public
* @return void
*/
function initialize($controllerz) {
function initialize(&$controller, $settings) {
foreach ($settings as $key => $value) {
if (is_numeric($key)) {
$this->{$value} = true;
@ -121,7 +121,7 @@ class AppleComponent extends Component {
* @access public
* @return void
*/
function startup($controller) {
function startup(&$controller) {
$this->testName = $controller->name;
}
}
@ -149,7 +149,7 @@ class OrangeComponent extends Component {
* @access public
* @return void
*/
function initialize($controller) {
function initialize(&$controller) {
$this->Controller = $controller;
$this->Banana->testField = 'OrangeField';
}
@ -160,7 +160,7 @@ class OrangeComponent extends Component {
* @param Controller $controller
* @return string
*/
public function startup($controller) {
public function startup(&$controller) {
$controller->foo = 'pass';
}
}
@ -187,7 +187,7 @@ class BananaComponent extends Component {
* @param Controller $controller
* @return string
*/
public function startup($controller) {
public function startup(&$controller) {
$controller->bar = 'fail';
}
}
@ -261,7 +261,7 @@ class ComponentTest extends CakeTestCase {
function setUp() {
$this->_pluginPaths = App::path('plugins');
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
}

View file

@ -89,7 +89,7 @@ class ComponentCollectionTest extends CakeTestCase {
*/
function testLoadPluginComponent() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
));
$result = $this->Components->load('TestPlugin.OtherComponent');
$this->assertType('OtherComponentComponent', $result, 'Component class is wrong.');

View file

@ -268,7 +268,7 @@ class IniAclTest extends CakeTestCase {
* @return void
*/
function testCheck() {
$iniFile = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS . 'acl.ini.php';
$iniFile = LIBS . 'tests' . DS . 'test_app' . DS . 'config'. DS . 'acl.ini.php';
$Ini = new IniAcl();
$Ini->config = $Ini->readConfigFile($iniFile);
@ -291,7 +291,7 @@ class IniAclTest extends CakeTestCase {
* @return void
*/
function testCheckArray() {
$iniFile = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS . 'acl.ini.php';
$iniFile = LIBS . 'tests' . DS . 'test_app' . DS . 'config'. DS . 'acl.ini.php';
$Ini = new IniAcl();
$Ini->config = $Ini->readConfigFile($iniFile);

View file

@ -53,7 +53,7 @@ class TestAuthComponent extends AuthComponent {
* @access public
* @return void
*/
function _stop($status = 0) {
function _stop() {
$this->testStop = true;
}
}
@ -499,8 +499,7 @@ class AuthTest extends CakeTestCase {
);
$this->Controller->beforeFilter();
$view = new View($this->Controller);
ClassRegistry::addObject('view', $view);
ClassRegistry::addObject('view', new View($this->Controller));
$this->Controller->Session->delete('Auth');
$this->Controller->Session->delete('Message.auth');
@ -1396,8 +1395,8 @@ class AuthTest extends CakeTestCase {
// Adding plugins
Cache::delete('object_map', '_cake_core_');
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS)
), true);
App::objects('plugin', null, false);
@ -1454,7 +1453,7 @@ class AuthTest extends CakeTestCase {
*/
function testAjaxLogin() {
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$_SERVER['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest";

View file

@ -230,11 +230,10 @@ class EmailComponentTest extends CakeTestCase {
$this->Controller->Components->init($this->Controller);
$this->Controller->EmailTest->initialize($this->Controller, array());
$view = new View($this->Controller);
ClassRegistry::addObject('view', $view);
ClassRegistry::addObject('view', new View($this->Controller));
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
}
@ -754,7 +753,7 @@ HTMLBLOC;
*/
function testMessageRetrievalWithoutTemplate() {
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$this->Controller->EmailTest->to = 'postmaster@localhost';
@ -792,7 +791,7 @@ HTMLBLOC;
*/
function testMessageRetrievalWithTemplate() {
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$this->Controller->set('value', 22091985);
@ -1124,8 +1123,8 @@ HTMLBLOC;
function testPluginCustomViewClass() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$this->Controller->view = 'TestPlugin.Email';

View file

@ -673,7 +673,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
*/
function testAjaxRedirectAsRequestAction() {
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
), true);
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));
@ -702,7 +702,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
*/
function testAjaxRedirectAsRequestActionStillRenderingLayout() {
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
), true);
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));

View file

@ -107,13 +107,13 @@ class ControllerPost extends CakeTestModel {
* @access public
* @return void
*/
function find($conditions = null, $fields = array(), $order = null, $recursive = null) {
if ($conditions == 'popular') {
function find($type, $options = array()) {
if ($type == 'popular') {
$conditions = array($this->name . '.' . $this->primaryKey .' > ' => '1');
$options = Set::merge($fields, compact('conditions'));
return parent::find('all', $fields);
$options = Set::merge($options, compact('conditions'));
return parent::find('all', $options);
}
return parent::find($conditions, $fields);
return parent::find($type, $options);
}
}
@ -320,7 +320,7 @@ class TestComponent extends Object {
* @access public
* @return void
*/
function initialize($controller) {
function initialize(&$controller) {
}
/**
@ -329,7 +329,7 @@ class TestComponent extends Object {
* @access public
* @return void
*/
function startup($controller) {
function startup(&$controller) {
}
/**
* shutdown method
@ -337,14 +337,14 @@ class TestComponent extends Object {
* @access public
* @return void
*/
function shutdown($controller) {
function shutdown(&$controller) {
}
/**
* beforeRender callback
*
* @return void
*/
function beforeRender($controller) {
function beforeRender(&$controller) {
if ($this->viewclass) {
$controller->view = $this->viewclass;
}
@ -442,9 +442,9 @@ class ControllerTest extends CakeTestCase {
*/
function testLoadModelInPlugins() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'controllers' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS)
));
App::uses('TestPluginController', 'TestPlugin.Controller');
@ -491,7 +491,7 @@ class ControllerTest extends CakeTestCase {
unset($Controller);
App::build(array('plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
App::build(array('plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
$Controller = new Controller($request);
$Controller->uses = array('TestPlugin.TestPluginPost');
@ -581,7 +581,7 @@ class ControllerTest extends CakeTestCase {
$this->assertEqual($result, $expected);
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$Controller = new Controller($request);
$Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
@ -643,7 +643,7 @@ class ControllerTest extends CakeTestCase {
*/
function testRender() {
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
), true);
$request = new CakeRequest('controller_posts/index');
@ -685,7 +685,7 @@ class ControllerTest extends CakeTestCase {
$core = App::core('views');
App::build(array(
'views' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS,
LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS,
$core[0]
)
), true);

View file

@ -28,6 +28,16 @@ App::uses('PagesController', 'Controller');
*/
class PagesControllerTest extends CakeTestCase {
/**
* endTest method
*
* @access public
* @return void
*/
function endTest() {
App::build();
}
/**
* testDisplay method
*
@ -36,7 +46,7 @@ class PagesControllerTest extends CakeTestCase {
*/
function testDisplay() {
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS, LIBS . 'libs' . DS . 'view' . DS)
));
$Pages = new PagesController(new CakeRequest(null, false));

View file

@ -93,8 +93,8 @@ class TestScaffoldMock extends Scaffold {
*
* @param unknown_type $params
*/
function _scaffold(CakeRequest $request) {
$this->_params = $request;
function _scaffold($params) {
$this->_params = $params;
}
/**
@ -287,8 +287,8 @@ class ScaffoldViewTest extends CakeTestCase {
$this->Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
}
@ -315,35 +315,35 @@ class ScaffoldViewTest extends CakeTestCase {
$this->Controller->request->params['action'] = 'index';
$ScaffoldView = new TestScaffoldView($this->Controller);
$result = $ScaffoldView->testGetFilename('index');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'index.ctp';
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'index.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('edit');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('add');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('view');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'view.ctp';
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'view.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_index');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'index.ctp';
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'index.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_view');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'view.ctp';
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'view.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_edit');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_add');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('error');
@ -357,11 +357,11 @@ class ScaffoldViewTest extends CakeTestCase {
$ScaffoldView = new TestScaffoldView($Controller);
$result = $ScaffoldView->testGetFilename('admin_edit');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.form.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('edit');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.form.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.form.ctp';
$this->assertEqual($result, $expected);
$Controller = new ScaffoldMockController($this->request);
@ -376,12 +376,12 @@ class ScaffoldViewTest extends CakeTestCase {
$ScaffoldView = new TestScaffoldView($Controller);
$result = $ScaffoldView->testGetFilename('admin_add');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins'
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins'
. DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('add');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins'
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins'
. DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.form.ctp';
$this->assertEqual($result, $expected);
@ -400,7 +400,7 @@ class ScaffoldViewTest extends CakeTestCase {
$ScaffoldView = new TestScaffoldView($this->Controller);
$result = $ScaffoldView->testGetFilename('index');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS
. 'themed' . DS . 'test_theme' . DS . 'posts' . DS . 'scaffold.index.ctp';
$this->assertEqual($result, $expected);
}

View file

@ -787,7 +787,7 @@ class DispatcherTest extends CakeTestCase {
*/
public function testDispatchBasic() {
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$Dispatcher = new TestDispatcher();
Configure::write('App.baseUrl', '/index.php');
@ -1078,7 +1078,7 @@ class DispatcherTest extends CakeTestCase {
}
Router::reload();
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
App::objects('plugin', null, false);
@ -1178,7 +1178,7 @@ class DispatcherTest extends CakeTestCase {
public function testTestPluginDispatch() {
$Dispatcher = new TestDispatcher();
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
App::objects('plugin', null, false);
Router::reload();
@ -1236,9 +1236,9 @@ class DispatcherTest extends CakeTestCase {
Router::reload();
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'vendors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS),
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'vendors' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'vendors'. DS),
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$Dispatcher = new TestDispatcher();
@ -1262,21 +1262,21 @@ class DispatcherTest extends CakeTestCase {
$Dispatcher->dispatch(new CakeRequest('theme/test_theme/flash/theme_test.swf'));
$result = ob_get_clean();
$file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'flash' . DS . 'theme_test.swf');
$file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'flash' . DS . 'theme_test.swf');
$this->assertEqual($file, $result);
$this->assertEqual('this is just a test to load swf file from the theme.', $result);
ob_start();
$Dispatcher->dispatch(new CakeRequest('theme/test_theme/pdfs/theme_test.pdf'));
$result = ob_get_clean();
$file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'pdfs' . DS . 'theme_test.pdf');
$file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'pdfs' . DS . 'theme_test.pdf');
$this->assertEqual($file, $result);
$this->assertEqual('this is just a test to load pdf file from the theme.', $result);
ob_start();
$Dispatcher->dispatch(new CakeRequest('theme/test_theme/img/test.jpg'));
$result = ob_get_clean();
$file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'img' . DS . 'test.jpg');
$file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'img' . DS . 'test.jpg');
$this->assertEqual($file, $result);
ob_start();
@ -1297,20 +1297,20 @@ class DispatcherTest extends CakeTestCase {
ob_start();
$Dispatcher->asset('test_plugin/root.js');
$result = ob_get_clean();
$expected = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'root.js');
$expected = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'root.js');
$this->assertEqual($result, $expected);
ob_start();
$Dispatcher->dispatch(new CakeRequest('test_plugin/flash/plugin_test.swf'));
$result = ob_get_clean();
$file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'flash' . DS . 'plugin_test.swf');
$file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'flash' . DS . 'plugin_test.swf');
$this->assertEqual($file, $result);
$this->assertEqual('this is just a test to load swf file from the plugin.', $result);
ob_start();
$Dispatcher->dispatch(new CakeRequest('test_plugin/pdfs/plugin_test.pdf'));
$result = ob_get_clean();
$file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'pdfs' . DS . 'plugin_test.pdf');
$file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'pdfs' . DS . 'plugin_test.pdf');
$this->assertEqual($file, $result);
$this->assertEqual('this is just a test to load pdf file from the plugin.', $result);
@ -1332,7 +1332,7 @@ class DispatcherTest extends CakeTestCase {
ob_start();
$Dispatcher->asset('test_plugin/img/cake.icon.gif');
$result = ob_get_clean();
$file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' .DS . 'webroot' . DS . 'img' . DS . 'cake.icon.gif');
$file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' .DS . 'webroot' . DS . 'img' . DS . 'cake.icon.gif');
$this->assertEqual($file, $result);
ob_start();
@ -1435,7 +1435,7 @@ class DispatcherTest extends CakeTestCase {
Router::connect('/', array('controller' => 'test_cached_pages', 'action' => 'index'));
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
), true);
$dispatcher = new TestDispatcher();

View file

@ -39,8 +39,8 @@ class ErrorHandlerTest extends CakeTestCase {
function setUp() {
App::build(array(
'views' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS,
TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS,
LIBS . 'libs' . DS . 'view' . DS
)
), true);
Router::reload();

View file

@ -69,7 +69,7 @@ class BlueberryComponent extends Component {
* @access public
* @return void
*/
function initialize($controller) {
function initialize(&$controller) {
$this->testName = 'BlueberryComponent';
}
}
@ -162,8 +162,8 @@ class ExceptionRendererTest extends CakeTestCase {
function setUp() {
App::build(array(
'views' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS,
TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS,
LIBS . 'libs' . DS . 'view' . DS
)
), true);
Router::reload();

View file

@ -149,7 +149,7 @@ class FolderTest extends CakeTestCase {
* @return void
*/
function testOperations() {
$path = TEST_CAKE_CORE_INCLUDE_PATH . 'console' . DS . 'templates' . DS . 'skel';
$path = LIBS . 'console' . DS . 'templates' . DS . 'skel';
$Folder = new Folder($path);
$result = is_dir($Folder->pwd());
@ -222,7 +222,7 @@ class FolderTest extends CakeTestCase {
public function testChmod() {
$this->skipIf(DIRECTORY_SEPARATOR === '\\', '%s Folder permissions tests not supported on Windows');
$path = TEST_CAKE_CORE_INCLUDE_PATH . 'console' . DS . 'templates' . DS . 'skel';
$path = LIBS . 'console' . DS . 'templates' . DS . 'skel';
$Folder = new Folder($path);
$subdir = 'test_folder_new';
@ -318,42 +318,42 @@ class FolderTest extends CakeTestCase {
$Folder = new Folder();
$expected = array(
array(
TEST_CAKE_CORE_INCLUDE_PATH . 'config',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding'
LIBS . 'config',
LIBS . 'config' . DS . 'unicode',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding'
),
array(
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'paths.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0080_00ff.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0100_017f.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0180_024F.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0250_02af.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0370_03ff.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0400_04ff.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0500_052f.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0530_058f.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '1e00_1eff.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '1f00_1fff.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2100_214f.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2150_218f.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2460_24ff.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c00_2c5f.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c60_2c7f.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c80_2cff.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . 'ff00_ffef.php'
LIBS . 'config' . DS . 'config.php',
LIBS . 'config' . DS . 'paths.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0080_00ff.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0100_017f.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0180_024F.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0250_02af.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0370_03ff.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0400_04ff.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0500_052f.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0530_058f.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '1e00_1eff.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '1f00_1fff.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2100_214f.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2150_218f.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2460_24ff.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c00_2c5f.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c60_2c7f.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c80_2cff.php',
LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . 'ff00_ffef.php'
)
);
$result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false);
$result = $Folder->tree(LIBS . 'config', false);
$this->assertIdentical(array_diff($expected[0], $result[0]), array());
$this->assertIdentical(array_diff($result[0], $expected[0]), array());
$result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false, 'dir');
$result = $Folder->tree(LIBS . 'config', false, 'dir');
$this->assertIdentical(array_diff($expected[0], $result), array());
$this->assertIdentical(array_diff($result, $expected[0]), array());
$result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false, 'files');
$result = $Folder->tree(LIBS . 'config', false, 'files');
$this->assertIdentical(array_diff($expected[1], $result), array());
$this->assertIdentical(array_diff($result, $expected[1]), array());
}
@ -490,7 +490,7 @@ class FolderTest extends CakeTestCase {
*/
function testFind() {
$Folder = new Folder();
$Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH . 'config');
$Folder->cd(LIBS . 'config');
$result = $Folder->find();
$expected = array('config.php', 'paths.php');
$this->assertIdentical(array_diff($expected, $result), array());
@ -543,19 +543,19 @@ class FolderTest extends CakeTestCase {
*/
function testFindRecursive() {
$Folder = new Folder();
$Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH);
$Folder->cd(LIBS);
$result = $Folder->findRecursive('(config|paths)\.php');
$expected = array(
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'paths.php'
LIBS . 'config' . DS . 'config.php',
LIBS . 'config' . DS . 'paths.php'
);
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertIdentical(array_diff($result, $expected), array());
$result = $Folder->findRecursive('(config|paths)\.php', true);
$expected = array(
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'paths.php'
LIBS . 'config' . DS . 'config.php',
LIBS . 'config' . DS . 'paths.php'
);
$this->assertIdentical($result, $expected);
@ -589,7 +589,7 @@ class FolderTest extends CakeTestCase {
);
$this->assertIdentical($result, $expected);
$Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH . 'config');
$Folder->cd(LIBS . 'config');
$Folder->cd(TMP);
$Folder->delete($Folder->pwd() . DS . 'testme');
$File->delete();

View file

@ -41,7 +41,7 @@ class HtmlCoverageReportTest extends CakeTestCase {
function testGetPathFilter() {
$this->Coverage->appTest = false;
$result = $this->Coverage->getPathFilter();
$this->assertEquals(TEST_CAKE_CORE_INCLUDE_PATH, $result);
$this->assertEquals(LIBS, $result);
$this->Coverage->appTest = true;
$result = $this->Coverage->getPathFilter();
@ -60,7 +60,7 @@ class HtmlCoverageReportTest extends CakeTestCase {
*/
function testFilterCoverageDataByPathRemovingElements() {
$data = array(
TEST_CAKE_CORE_INCLUDE_PATH . 'dispatcher.php' => array(
LIBS . 'dispatcher.php' => array(
10 => -1,
12 => 1
),
@ -70,8 +70,8 @@ class HtmlCoverageReportTest extends CakeTestCase {
)
);
$this->Coverage->setCoverage($data);
$result = $this->Coverage->filterCoverageDataByPath(TEST_CAKE_CORE_INCLUDE_PATH);
$this->assertTrue(isset($result[TEST_CAKE_CORE_INCLUDE_PATH . 'dispatcher.php']));
$result = $this->Coverage->filterCoverageDataByPath(LIBS);
$this->assertTrue(isset($result[LIBS . 'dispatcher.php']));
$this->assertFalse(isset($result[APP . 'app_model.php']));
}

View file

@ -36,8 +36,8 @@ class I18nTest extends CakeTestCase {
function setUp() {
Cache::delete('object_map', '_cake_core_');
App::build(array(
'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'locales' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'locale' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
App::objects('plugin', null, false);
}
@ -2434,7 +2434,7 @@ class I18nTest extends CakeTestCase {
*/
function testPluginTranslation() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
Configure::write('Config.language', 'po');

View file

@ -659,7 +659,7 @@ class CakeSchemaTest extends CakeTestCase {
function testSchemaReadWithPlugins() {
App::objects('model', null, false);
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$Schema = new CakeSchema();
@ -977,7 +977,7 @@ class CakeSchemaTest extends CakeTestCase {
*/
function testSchemaLoadingFromPlugin() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$Other = $this->Schema->load(array('name' => 'TestPluginApp', 'plugin' => 'TestPlugin'));
$this->assertEqual($Other->name, 'TestPluginApp');

View file

@ -99,7 +99,7 @@ class ConnectionManagerTest extends CakeTestCase {
*/
function testGetPluginDataSource() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$name = 'test_source';
@ -121,7 +121,7 @@ class ConnectionManagerTest extends CakeTestCase {
*/
function testGetPluginDataSourceAndPluginDriver() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$name = 'test_plugin_source_and_driver';
@ -145,7 +145,7 @@ class ConnectionManagerTest extends CakeTestCase {
*/
function testGetLocalDataSourceAndPluginDriver() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$name = 'test_local_source_and_plugin_driver';
@ -168,8 +168,8 @@ class ConnectionManagerTest extends CakeTestCase {
*/
function testGetPluginDataSourceAndLocalDriver() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'datasources' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'datasources' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS)
));
$name = 'test_plugin_source_and_local_driver';
@ -284,8 +284,8 @@ class ConnectionManagerTest extends CakeTestCase {
*/
function testConnectionData() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'datasources' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'datasources' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS)
));
$expected = array(

View file

@ -485,9 +485,9 @@ class ObjectTest extends CakeTestCase {
Configure::write('Cache.disable', false);
App::build(array(
'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins'. DS),
'behaviors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS),
'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins'. DS),
'behaviors' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS),
), true);
$this->assertFalse(class_exists('PersisterOneBehaviorBehavior'));
@ -546,8 +546,8 @@ class ObjectTest extends CakeTestCase {
$this->assertFalse(class_exists('ContainableBehavior'));
App::build(array(
'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS),
'behaviors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS),
'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS),
'behaviors' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS),
), true);
$this->assertFalse(class_exists('PersistOneBehaviorBehavior'));
@ -690,9 +690,9 @@ class ObjectTest extends CakeTestCase {
*/
function testRequestAction() {
App::build(array(
'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS),
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)
'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS),
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
'controllers' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)
));
$result = $this->object->requestAction('');
$this->assertFalse($result);
@ -730,7 +730,7 @@ class ObjectTest extends CakeTestCase {
*/
function testRequestActionPlugins() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
));
App::objects('plugin', null, false);
Router::reload();
@ -770,9 +770,9 @@ class ObjectTest extends CakeTestCase {
*/
function testRequestActionArray() {
App::build(array(
'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS),
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)
'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS),
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
'controllers' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)
));
$result = $this->object->requestAction(

View file

@ -1177,7 +1177,7 @@ class RouterTest extends CakeTestCase {
$paths = App::path('plugins');
App::build(array(
'plugins' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
)
), true);
App::objects('plugin', null, false);
@ -2191,7 +2191,7 @@ class RouterTest extends CakeTestCase {
function testConnectDefaultRoutes() {
App::build(array(
'plugins' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
)
), true);
App::objects('plugin', null, false);

View file

@ -553,8 +553,8 @@ class HelperTest extends CakeTestCase {
$_timestamp = Configure::read('Asset.timestamp');
Configure::write('Asset.timestamp', 'force');
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
));
$result = $this->Helper->assetTimestamp('/test_plugin/css/test_plugin_asset.css');
@ -793,7 +793,7 @@ class HelperTest extends CakeTestCase {
$this->Helper->theme = 'test_theme';
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$result = $this->Helper->webroot('/img/cake.power.gif');
@ -805,7 +805,7 @@ class HelperTest extends CakeTestCase {
$this->assertEqual($result, $expected);
$webRoot = Configure::read('App.www_root');
Configure::write('App.www_root', TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'webroot' . DS);
Configure::write('App.www_root', LIBS . 'tests' . DS . 'test_app' . DS . 'webroot' . DS);
$result = $this->Helper->webroot('/img/cake.power.gif');
$expected = '/theme/test_theme/img/cake.power.gif';
@ -859,7 +859,7 @@ class HelperTest extends CakeTestCase {
*/
function testLazyLoadingHelpers() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
));
$Helper = new TestHelper($this->View);
$this->assertType('OtherHelperHelper', $Helper->OtherHelper);

View file

@ -87,7 +87,7 @@ class HelperCollectionTest extends CakeTestCase {
*/
function testLoadPluginHelper() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
));
$result = $this->Helpers->load('TestPlugin.OtherHelper');
$this->assertType('OtherHelperHelper', $result, 'Helper class is wrong.');

View file

@ -86,7 +86,7 @@ class CacheHelperTest extends CakeTestCase {
Configure::write('Cache.check', true);
Configure::write('Cache.disable', false);
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
), true);
}

View file

@ -327,7 +327,7 @@ class HtmlHelperTest extends CakeTestCase {
$file = new File($testfile, true);
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
Configure::write('Asset.timestamp', true);
Configure::write('debug', 1);
@ -362,10 +362,10 @@ class HtmlHelperTest extends CakeTestCase {
*/
function testThemeAssetsInMainWebrootPath() {
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$webRoot = Configure::read('App.www_root');
Configure::write('App.www_root', TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'webroot' . DS);
Configure::write('App.www_root', LIBS . 'tests' . DS . 'test_app' . DS . 'webroot' . DS);
$this->Html->theme = 'test_theme';
$result = $this->Html->css('webroot_test');
@ -608,7 +608,7 @@ class HtmlHelperTest extends CakeTestCase {
$file = new File($testfile, true);
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$this->Html->webroot = '/';

View file

@ -129,7 +129,7 @@ class SessionHelperTest extends CakeTestCase {
$this->assertEqual($result, $expected);
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$result = $this->Session->flash('notification', true);
$result = str_replace("\r\n", "\n", $result);

View file

@ -658,7 +658,7 @@ class TimeHelperTest extends CakeTestCase {
*/
function testConvertSpecifiers() {
App::build(array(
'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
'locales' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
), true);
Configure::write('Config.language', 'time_test');
$time = strtotime('Thu Jan 14 11:43:39 2010');
@ -748,7 +748,7 @@ class TimeHelperTest extends CakeTestCase {
*/
function testI18nFormat() {
App::build(array(
'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
'locales' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
), true);
Configure::write('Config.language', 'time_test');
$time = strtotime('Thu Jan 14 13:59:28 2010');

View file

@ -74,7 +74,7 @@ class MediaViewTest extends CakeTestCase {
*/
function testRender() {
$this->MediaView->viewVars = array(
'path' => TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
'path' => LIBS . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
'id' => 'test_asset.css',
'extension' => 'css',
);
@ -120,7 +120,7 @@ class MediaViewTest extends CakeTestCase {
*/
function testConnectionAborted() {
$this->MediaView->viewVars = array(
'path' => TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
'path' => LIBS . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
'id' => 'test_asset.css',
'extension' => 'css',
);
@ -146,7 +146,7 @@ class MediaViewTest extends CakeTestCase {
*/
function testConnectionAbortedOnBuffering() {
$this->MediaView->viewVars = array(
'path' => TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
'path' => LIBS . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
'id' => 'test_asset.css',
'extension' => 'css',
);

View file

@ -121,8 +121,8 @@ class ThemeViewTest extends CakeTestCase {
$this->PostsController->index();
$this->ThemeView = new ThemeView($this->PostsController);
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
}
@ -154,15 +154,16 @@ class ThemeViewTest extends CakeTestCase {
$this->Controller->theme = 'test_theme';
$ThemeView = new TestThemeView($this->Controller);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'tests' . DS .'index.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'tests' . DS .'index.ctp';
$result = $ThemeView->getViewFileName('index');
debug($expected);
$this->assertEqual($result, $expected);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'layouts' . DS .'plugin_default.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'layouts' . DS .'plugin_default.ctp';
$result = $ThemeView->getLayoutFileName('plugin_default');
$this->assertEqual($result, $expected);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'layouts' . DS .'default.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'layouts' . DS .'default.ctp';
$result = $ThemeView->getLayoutFileName('default');
$this->assertEqual($result, $expected);
}
@ -182,25 +183,25 @@ class ThemeViewTest extends CakeTestCase {
$ThemeView = new TestThemeView($this->Controller);
$ThemeView->theme = 'test_theme';
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp';
$result = $ThemeView->getViewFileName('home');
$this->assertEqual($result, $expected);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'posts' . DS .'index.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'posts' . DS .'index.ctp';
$result = $ThemeView->getViewFileName('/posts/index');
$this->assertEqual($result, $expected);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'layouts' . DS .'default.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'layouts' . DS .'default.ctp';
$result = $ThemeView->getLayoutFileName();
$this->assertEqual($result, $expected);
$ThemeView->layoutPath = 'rss';
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'rss' . DS . 'default.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'rss' . DS . 'default.ctp';
$result = $ThemeView->getLayoutFileName();
$this->assertEqual($result, $expected);
$ThemeView->layoutPath = 'email' . DS . 'html';
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'email' . DS . 'html' . DS . 'default.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'email' . DS . 'html' . DS . 'default.ctp';
$result = $ThemeView->getLayoutFileName();
$this->assertEqual($result, $expected);
}

View file

@ -201,10 +201,10 @@ class ViewTest extends CakeTestCase {
$this->PostsController->index();
$this->View = new View($this->PostsController);
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS,
TEST_CAKE_CORE_INCLUDE_PATH . 'View' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS,
LIBS . 'View' . DS
)
), true);
@ -238,11 +238,11 @@ class ViewTest extends CakeTestCase {
$View = new TestView($this->Controller);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS .'tests' . DS .'index.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS .'tests' . DS .'index.ctp';
$result = $View->getViewFileName('index');
$this->assertEqual($result, $expected);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEqual($result, $expected);
}
@ -265,10 +265,10 @@ class ViewTest extends CakeTestCase {
$paths = $View->paths('test_plugin');
$expected = array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'plugins' . DS . 'test_plugin' . DS,
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'views' . DS,
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS,
TEST_CAKE_CORE_INCLUDE_PATH . 'View' . DS
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'plugins' . DS . 'test_plugin' . DS,
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'views' . DS,
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS,
LIBS . 'View' . DS
);
$this->assertEqual($paths, $expected);
}
@ -286,15 +286,15 @@ class ViewTest extends CakeTestCase {
$View = new TestView($this->Controller);
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS .'tests' . DS .'index.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS .'tests' . DS .'index.ctp';
$result = $View->getViewFileName('index');
$this->assertEqual($result, $expected);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEqual($result, $expected);
}
@ -314,29 +314,29 @@ class ViewTest extends CakeTestCase {
$View = new TestView($this->Controller);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp';
$result = $View->getViewFileName('home');
$this->assertEqual($result, $expected);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
$result = $View->getViewFileName('/posts/index');
$this->assertEqual($result, $expected);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
$result = $View->getViewFileName('../posts/index');
$this->assertEqual($result, $expected);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEqual($result, $expected);
$View->layoutPath = 'rss';
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'rss' . DS . 'default.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'rss' . DS . 'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEqual($result, $expected);
$View->layoutPath = 'email' . DS . 'html';
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'email' . DS . 'html' . DS . 'default.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'email' . DS . 'html' . DS . 'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEqual($result, $expected);
@ -733,7 +733,7 @@ class ViewTest extends CakeTestCase {
$result = $View->getViewFileName('../themed/test_theme/posts/index');
$this->assertPattern('/themed(\/|\\\)test_theme(\/|\\\)posts(\/|\\\)index.ctp/', $result);
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
$result = $View->getViewFileName('../posts/index');
$this->assertEqual($result, $expected);

View file

@ -137,7 +137,7 @@ class XmlTest extends CakeTestCase {
$this->assertEqual($obj->firstChild->nodeName, 'tag');
$this->assertEqual($obj->firstChild->nodeValue, 'value');
$xml = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'fixtures' . DS . 'sample.xml';
$xml = LIBS . 'tests' . DS . 'fixtures' . DS . 'sample.xml';
$obj = Xml::build($xml);
$this->assertEqual($obj->getName(), 'tags');
$this->assertEqual(count($obj), 2);
@ -378,7 +378,7 @@ class XmlTest extends CakeTestCase {
$obj = Xml::build($xml);
$this->assertEqual(Xml::toArray($obj), array('tag' => 'name'));
$xml = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'fixtures' . DS . 'sample.xml';
$xml = LIBS . 'tests' . DS . 'fixtures' . DS . 'sample.xml';
$obj = Xml::build($xml);
$expected = array(
'tags' => array(
@ -520,7 +520,7 @@ class XmlTest extends CakeTestCase {
* @return void
*/
public function testRss() {
$rss = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'fixtures' . DS . 'rss.xml');
$rss = file_get_contents(LIBS . 'tests' . DS . 'fixtures' . DS . 'rss.xml');
$rssAsArray = Xml::toArray(Xml::build($rss));
$this->assertEqual($rssAsArray['rss']['@version'], '2.0');
$this->assertEqual(count($rssAsArray['rss']['channel']['item']), 2);
@ -651,7 +651,7 @@ class XmlTest extends CakeTestCase {
* @return void
*/
public function testSoap() {
$xmlRequest = Xml::build(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'fixtures' . DS . 'soap_request.xml');
$xmlRequest = Xml::build(LIBS . 'tests' . DS . 'fixtures' . DS . 'soap_request.xml');
$expected = array(
'Envelope' => array(
'@soap:encodingStyle' => 'http://www.w3.org/2001/12/soap-encoding',
@ -664,7 +664,7 @@ class XmlTest extends CakeTestCase {
);
$this->assertEqual(Xml::toArray($xmlRequest), $expected);
$xmlResponse = Xml::build(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'fixtures' . DS . 'soap_response.xml');
$xmlResponse = Xml::build(LIBS . 'tests' . DS . 'fixtures' . DS . 'soap_response.xml');
$expected = array(
'Envelope' => array(
'@soap:encodingStyle' => 'http://www.w3.org/2001/12/soap-encoding',