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); 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) { if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.', true)); die(__('Debug setting does not allow access to this url.', true));
} }

View file

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

View file

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

View file

@ -50,7 +50,7 @@ ini_set('display_errors', 1);
* *
*/ */
if (!defined('CAKE_CORE_INCLUDE_PATH')) { 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('APP_PATH', ROOT . DS . APP_DIR . DS);
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . 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); 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) { if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.', true)); 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(); CakeTestSuiteDispatcher::run();

View file

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

View file

@ -128,7 +128,7 @@ class CakeFixtureManager {
$fixturePaths = array( $fixturePaths = array(
TESTS . 'fixtures', TESTS . 'fixtures',
VENDORS . 'tests' . DS . '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() { public function setUp() {
App::build(array( 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'); $this->_language = Configure::read('Config.language');
} }

View file

@ -89,7 +89,7 @@ class TaskCollectionTest extends CakeTestCase {
$dispatcher = $this->getMock('ShellDispatcher', array(), array(), '', false); $dispatcher = $this->getMock('ShellDispatcher', array(), array(), '', false);
$shell = $this->getMock('Shell', array(), array(), '', false); $shell = $this->getMock('Shell', array(), array(), '', false);
App::build(array( 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); $this->Tasks = new TaskCollection($shell, $dispatcher);

View file

@ -119,11 +119,11 @@ class ShellDispatcherTest extends CakeTestCase {
parent::setUp(); parent::setUp();
App::build(array( App::build(array(
'plugins' => 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( 'shells' => array(
CORE_PATH ? CONSOLE_LIBS : ROOT . DS . CONSOLE_LIBS, 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); ), true);
} }

View file

@ -39,13 +39,13 @@ class CommandListTest extends CakeTestCase {
parent::setUp(); parent::setUp();
App::build(array( App::build(array(
'plugins' => 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( 'shells' => array(
CORE_PATH ? CORE_PATH ?
CORE_PATH . CAKE . 'console' . DS . 'shells' . DS : CORE_PATH . CAKE . 'console' . DS . 'shells' . DS :
CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . '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); ), true);
App::objects('plugin', null, false); App::objects('plugin', null, false);

View file

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

View file

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

View file

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

View file

@ -126,7 +126,7 @@ class TemplateTaskTest extends CakeTestCase {
public function testGenerate() { public function testGenerate() {
App::build(array( App::build(array(
'shells' => 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(); $this->Task->initialize();
@ -146,7 +146,7 @@ class TemplateTaskTest extends CakeTestCase {
public function testGenerateWithTemplateFallbacks() { public function testGenerateWithTemplateFallbacks() {
App::build(array( App::build(array(
'shells' => 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 CAKE_CORE_INCLUDE_PATH . DS . 'console' . DS
) )
)); ));

View file

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

View file

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

View file

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

View file

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

View file

@ -35,7 +35,7 @@ class IniReaderTest extends CakeTestCase {
*/ */
function setup() { function setup() {
parent::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() { function setUp() {
parent::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 * test reading files
@ -81,7 +81,7 @@ class PhpReaderTest extends CakeTestCase {
*/ */
function testReadPluginValue() { function testReadPluginValue() {
App::build(array( 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); ), true);
$reader = new PhpReader($this->path); $reader = new PhpReader($this->path);
$result = $reader->read('TestPlugin.load'); $result = $reader->read('TestPlugin.load');

View file

@ -200,7 +200,7 @@ class ConfigureTest extends CakeTestCase {
* @return void * @return void
*/ */
function testLoad() { 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'); $result = Configure::load('var_test', 'test');
$this->assertTrue($result); $this->assertTrue($result);
@ -215,7 +215,7 @@ class ConfigureTest extends CakeTestCase {
* @return void * @return void
*/ */
function testLoadPlugin() { 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()); Configure::config('test', new PhpReader());
$result = Configure::load('test_plugin.load', 'test'); $result = Configure::load('test_plugin.load', 'test');

View file

@ -53,7 +53,7 @@ class ParamTestComponent extends Component {
* @access public * @access public
* @return void * @return void
*/ */
function initialize($controllerz) { function initialize(&$controller, $settings) {
foreach ($settings as $key => $value) { foreach ($settings as $key => $value) {
if (is_numeric($key)) { if (is_numeric($key)) {
$this->{$value} = true; $this->{$value} = true;
@ -121,7 +121,7 @@ class AppleComponent extends Component {
* @access public * @access public
* @return void * @return void
*/ */
function startup($controller) { function startup(&$controller) {
$this->testName = $controller->name; $this->testName = $controller->name;
} }
} }
@ -149,7 +149,7 @@ class OrangeComponent extends Component {
* @access public * @access public
* @return void * @return void
*/ */
function initialize($controller) { function initialize(&$controller) {
$this->Controller = $controller; $this->Controller = $controller;
$this->Banana->testField = 'OrangeField'; $this->Banana->testField = 'OrangeField';
} }
@ -160,7 +160,7 @@ class OrangeComponent extends Component {
* @param Controller $controller * @param Controller $controller
* @return string * @return string
*/ */
public function startup($controller) { public function startup(&$controller) {
$controller->foo = 'pass'; $controller->foo = 'pass';
} }
} }
@ -187,7 +187,7 @@ class BananaComponent extends Component {
* @param Controller $controller * @param Controller $controller
* @return string * @return string
*/ */
public function startup($controller) { public function startup(&$controller) {
$controller->bar = 'fail'; $controller->bar = 'fail';
} }
} }
@ -261,7 +261,7 @@ class ComponentTest extends CakeTestCase {
function setUp() { function setUp() {
$this->_pluginPaths = App::path('plugins'); $this->_pluginPaths = App::path('plugins');
App::build(array( 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() { function testLoadPluginComponent() {
App::build(array( 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'); $result = $this->Components->load('TestPlugin.OtherComponent');
$this->assertType('OtherComponentComponent', $result, 'Component class is wrong.'); $this->assertType('OtherComponentComponent', $result, 'Component class is wrong.');

View file

@ -268,7 +268,7 @@ class IniAclTest extends CakeTestCase {
* @return void * @return void
*/ */
function testCheck() { 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 = new IniAcl();
$Ini->config = $Ini->readConfigFile($iniFile); $Ini->config = $Ini->readConfigFile($iniFile);
@ -291,7 +291,7 @@ class IniAclTest extends CakeTestCase {
* @return void * @return void
*/ */
function testCheckArray() { 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 = new IniAcl();
$Ini->config = $Ini->readConfigFile($iniFile); $Ini->config = $Ini->readConfigFile($iniFile);

View file

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

View file

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

View file

@ -673,7 +673,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
*/ */
function testAjaxRedirectAsRequestAction() { function testAjaxRedirectAsRequestAction() {
App::build(array( 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); ), true);
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components)); $this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));
@ -702,7 +702,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
*/ */
function testAjaxRedirectAsRequestActionStillRenderingLayout() { function testAjaxRedirectAsRequestActionStillRenderingLayout() {
App::build(array( 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); ), true);
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components)); $this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));

View file

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

View file

@ -28,6 +28,16 @@ App::uses('PagesController', 'Controller');
*/ */
class PagesControllerTest extends CakeTestCase { class PagesControllerTest extends CakeTestCase {
/**
* endTest method
*
* @access public
* @return void
*/
function endTest() {
App::build();
}
/** /**
* testDisplay method * testDisplay method
* *
@ -36,7 +46,7 @@ class PagesControllerTest extends CakeTestCase {
*/ */
function testDisplay() { function testDisplay() {
App::build(array( 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)); $Pages = new PagesController(new CakeRequest(null, false));

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -36,8 +36,8 @@ class I18nTest extends CakeTestCase {
function setUp() { function setUp() {
Cache::delete('object_map', '_cake_core_'); Cache::delete('object_map', '_cake_core_');
App::build(array( 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),
'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); ), true);
App::objects('plugin', null, false); App::objects('plugin', null, false);
} }
@ -2434,7 +2434,7 @@ class I18nTest extends CakeTestCase {
*/ */
function testPluginTranslation() { function testPluginTranslation() {
App::build(array( 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'); Configure::write('Config.language', 'po');

View file

@ -659,7 +659,7 @@ class CakeSchemaTest extends CakeTestCase {
function testSchemaReadWithPlugins() { function testSchemaReadWithPlugins() {
App::objects('model', null, false); App::objects('model', null, false);
App::build(array( 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(); $Schema = new CakeSchema();
@ -977,7 +977,7 @@ class CakeSchemaTest extends CakeTestCase {
*/ */
function testSchemaLoadingFromPlugin() { function testSchemaLoadingFromPlugin() {
App::build(array( 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')); $Other = $this->Schema->load(array('name' => 'TestPluginApp', 'plugin' => 'TestPlugin'));
$this->assertEqual($Other->name, 'TestPluginApp'); $this->assertEqual($Other->name, 'TestPluginApp');

View file

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

View file

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

View file

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

View file

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

View file

@ -87,7 +87,7 @@ class HelperCollectionTest extends CakeTestCase {
*/ */
function testLoadPluginHelper() { function testLoadPluginHelper() {
App::build(array( 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'); $result = $this->Helpers->load('TestPlugin.OtherHelper');
$this->assertType('OtherHelperHelper', $result, 'Helper class is wrong.'); $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.check', true);
Configure::write('Cache.disable', false); Configure::write('Cache.disable', false);
App::build(array( 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); ), true);
} }

View file

@ -327,7 +327,7 @@ class HtmlHelperTest extends CakeTestCase {
$file = new File($testfile, true); $file = new File($testfile, true);
App::build(array( 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('Asset.timestamp', true);
Configure::write('debug', 1); Configure::write('debug', 1);
@ -362,10 +362,10 @@ class HtmlHelperTest extends CakeTestCase {
*/ */
function testThemeAssetsInMainWebrootPath() { function testThemeAssetsInMainWebrootPath() {
App::build(array( 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'); $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'; $this->Html->theme = 'test_theme';
$result = $this->Html->css('webroot_test'); $result = $this->Html->css('webroot_test');
@ -608,7 +608,7 @@ class HtmlHelperTest extends CakeTestCase {
$file = new File($testfile, true); $file = new File($testfile, true);
App::build(array( 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 = '/'; $this->Html->webroot = '/';

View file

@ -129,7 +129,7 @@ class SessionHelperTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
App::build(array( 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 = $this->Session->flash('notification', true);
$result = str_replace("\r\n", "\n", $result); $result = str_replace("\r\n", "\n", $result);

View file

@ -658,7 +658,7 @@ class TimeHelperTest extends CakeTestCase {
*/ */
function testConvertSpecifiers() { function testConvertSpecifiers() {
App::build(array( 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); ), true);
Configure::write('Config.language', 'time_test'); Configure::write('Config.language', 'time_test');
$time = strtotime('Thu Jan 14 11:43:39 2010'); $time = strtotime('Thu Jan 14 11:43:39 2010');
@ -748,7 +748,7 @@ class TimeHelperTest extends CakeTestCase {
*/ */
function testI18nFormat() { function testI18nFormat() {
App::build(array( 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); ), true);
Configure::write('Config.language', 'time_test'); Configure::write('Config.language', 'time_test');
$time = strtotime('Thu Jan 14 13:59:28 2010'); $time = strtotime('Thu Jan 14 13:59:28 2010');

View file

@ -74,7 +74,7 @@ class MediaViewTest extends CakeTestCase {
*/ */
function testRender() { function testRender() {
$this->MediaView->viewVars = array( $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', 'id' => 'test_asset.css',
'extension' => 'css', 'extension' => 'css',
); );
@ -120,7 +120,7 @@ class MediaViewTest extends CakeTestCase {
*/ */
function testConnectionAborted() { function testConnectionAborted() {
$this->MediaView->viewVars = array( $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', 'id' => 'test_asset.css',
'extension' => 'css', 'extension' => 'css',
); );
@ -146,7 +146,7 @@ class MediaViewTest extends CakeTestCase {
*/ */
function testConnectionAbortedOnBuffering() { function testConnectionAbortedOnBuffering() {
$this->MediaView->viewVars = array( $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', 'id' => 'test_asset.css',
'extension' => 'css', 'extension' => 'css',
); );

View file

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

View file

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

View file

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