mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
remove LIBS constant
libs always means the Cake lib - so use the CAKE constant
This commit is contained in:
parent
ff2d9e244a
commit
afa8f6b441
67 changed files with 571 additions and 434 deletions
|
@ -41,14 +41,14 @@ class ApiShell extends Shell {
|
||||||
*/
|
*/
|
||||||
public function initialize() {
|
public function initialize() {
|
||||||
$this->paths = array_merge($this->paths, array(
|
$this->paths = array_merge($this->paths, array(
|
||||||
'behavior' => LIBS . 'Model' . DS . 'Behavior' . DS,
|
'behavior' => CAKE . 'Model' . DS . 'Behavior' . DS,
|
||||||
'cache' => LIBS . 'Cache' . DS,
|
'cache' => CAKE . 'Cache' . DS,
|
||||||
'controller' => LIBS . 'Controller' . DS,
|
'controller' => CAKE . 'Controller' . DS,
|
||||||
'component' => LIBS . 'Controller' . DS . 'Component' . DS,
|
'component' => CAKE . 'Controller' . DS . 'Component' . DS,
|
||||||
'helper' => LIBS . 'View' . DS . 'Helper' . DS,
|
'helper' => CAKE . 'View' . DS . 'Helper' . DS,
|
||||||
'model' => LIBS . 'Model' . DS,
|
'model' => CAKE . 'Model' . DS,
|
||||||
'view' => LIBS . 'View' . DS,
|
'view' => CAKE . 'View' . DS,
|
||||||
'core' => LIBS
|
'core' => CAKE
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ class ProjectTask extends Shell {
|
||||||
public function createHome($dir) {
|
public function createHome($dir) {
|
||||||
$app = basename($dir);
|
$app = basename($dir);
|
||||||
$path = $dir . 'View' . DS . 'pages' . DS;
|
$path = $dir . 'View' . DS . 'pages' . DS;
|
||||||
$source = LIBS . 'Console' . DS . 'templates' . DS .'default' . DS . 'views' . DS . 'home.ctp';
|
$source = CAKE . 'Console' . DS . 'templates' . DS .'default' . DS . 'views' . DS . 'home.ctp';
|
||||||
include($source);
|
include($source);
|
||||||
return $this->createFile($path.'home.ctp', $output);
|
return $this->createFile($path.'home.ctp', $output);
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ class ProjectTask extends Shell {
|
||||||
$File = new File($path . 'Console' . DS . 'cake.php');
|
$File = new File($path . 'Console' . DS . 'cake.php');
|
||||||
$contents = $File->read();
|
$contents = $File->read();
|
||||||
if (preg_match('/(__CAKE_PATH__)/', $contents, $match)) {
|
if (preg_match('/(__CAKE_PATH__)/', $contents, $match)) {
|
||||||
$path = LIBS . 'Console' . DS;
|
$path = CAKE . 'Console' . DS;
|
||||||
$replacement = "'" . str_replace(DS, "' . DIRECTORY_SEPARATOR . '", $path) . "'";
|
$replacement = "'" . str_replace(DS, "' . DIRECTORY_SEPARATOR . '", $path) . "'";
|
||||||
$result = str_replace($match[0], $replacement, $contents);
|
$result = str_replace($match[0], $replacement, $contents);
|
||||||
if ($File->write($result)) {
|
if ($File->write($result)) {
|
||||||
|
@ -260,7 +260,7 @@ class ProjectTask extends Shell {
|
||||||
$contents = $File->read();
|
$contents = $File->read();
|
||||||
if (preg_match('/([\s]*Configure::write\(\'Security.cipherSeed\',[\s\'A-z0-9]*\);)/', $contents, $match)) {
|
if (preg_match('/([\s]*Configure::write\(\'Security.cipherSeed\',[\s\'A-z0-9]*\);)/', $contents, $match)) {
|
||||||
if (!class_exists('Security')) {
|
if (!class_exists('Security')) {
|
||||||
require LIBS . 'Utility' . DS . 'security.php';
|
require CAKE . 'Utility' . DS . 'security.php';
|
||||||
}
|
}
|
||||||
$string = substr(bin2hex(Security::generateAuthKey()), 0, 30);
|
$string = substr(bin2hex(Security::generateAuthKey()), 0, 30);
|
||||||
$result = str_replace($match[0], "\t" . 'Configure::write(\'Security.cipherSeed\', \''.$string.'\');', $contents);
|
$result = str_replace($match[0], "\t" . 'Configure::write(\'Security.cipherSeed\', \''.$string.'\');', $contents);
|
||||||
|
|
|
@ -563,7 +563,7 @@ class App {
|
||||||
if (empty($plugin)) {
|
if (empty($plugin)) {
|
||||||
$appLibs = empty(self::$__packages['Lib']) ? APPLIBS : current(self::$__packages['Lib']);
|
$appLibs = empty(self::$__packages['Lib']) ? APPLIBS : current(self::$__packages['Lib']);
|
||||||
$paths[] = $appLibs . $package . DS;
|
$paths[] = $appLibs . $package . DS;
|
||||||
$paths[] = LIBS . $package . DS;
|
$paths[] = CAKE . $package . DS;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($paths as $path) {
|
foreach ($paths as $path) {
|
||||||
|
@ -845,4 +845,4 @@ class App {
|
||||||
Cache::write('object_map', self::$__objects, '_cake_core_');
|
Cache::write('object_map', self::$__objects, '_cake_core_');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -295,7 +295,7 @@ class Configure {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$values = self::$_readers[$config]->read($key);
|
$values = self::$_readers[$config]->read($key);
|
||||||
|
|
||||||
if ($merge) {
|
if ($merge) {
|
||||||
$keys = array_keys($values);
|
$keys = array_keys($values);
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
|
@ -304,7 +304,7 @@ class Configure {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::write($values);
|
return self::write($values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ class Configure {
|
||||||
*/
|
*/
|
||||||
public static function version() {
|
public static function version() {
|
||||||
if (!isset(self::$_values['Cake']['version'])) {
|
if (!isset(self::$_values['Cake']['version'])) {
|
||||||
require(LIBS . 'Config' . DS . 'config.php');
|
require(CAKE . 'Config' . DS . 'config.php');
|
||||||
self::write($config);
|
self::write($config);
|
||||||
}
|
}
|
||||||
return self::$_values['Cake']['version'];
|
return self::$_values['Cake']['version'];
|
||||||
|
@ -373,4 +373,4 @@ interface ConfigReaderInterface {
|
||||||
* @return array An array of data to merge into the runtime configuration
|
* @return array An array of data to merge into the runtime configuration
|
||||||
*/
|
*/
|
||||||
function read($key);
|
function read($key);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ class Object {
|
||||||
$extra['url'] = array();
|
$extra['url'] = array();
|
||||||
}
|
}
|
||||||
$extra = array_merge(array('autoRender' => 0, 'return' => 1, 'bare' => 1, 'requested' => 1), $extra);
|
$extra = array_merge(array('autoRender' => 0, 'return' => 1, 'bare' => 1, 'requested' => 1), $extra);
|
||||||
|
|
||||||
if (is_string($url)) {
|
if (is_string($url)) {
|
||||||
$request = new CakeRequest($url);
|
$request = new CakeRequest($url);
|
||||||
} elseif (is_array($url)) {
|
} elseif (is_array($url)) {
|
||||||
|
@ -119,7 +119,7 @@ class Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop execution of the current script. Wraps exit() making
|
* Stop execution of the current script. Wraps exit() making
|
||||||
* testing easier.
|
* testing easier.
|
||||||
*
|
*
|
||||||
* @param $status see http://php.net/exit for values
|
* @param $status see http://php.net/exit for values
|
||||||
|
@ -139,7 +139,7 @@ class Object {
|
||||||
*/
|
*/
|
||||||
public function log($msg, $type = LOG_ERROR) {
|
public function log($msg, $type = LOG_ERROR) {
|
||||||
if (!class_exists('CakeLog')) {
|
if (!class_exists('CakeLog')) {
|
||||||
require LIBS . 'cake_log.php';
|
require CAKE . 'cake_log.php';
|
||||||
}
|
}
|
||||||
if (!is_string($msg)) {
|
if (!is_string($msg)) {
|
||||||
$msg = print_r($msg, true);
|
$msg = print_r($msg, true);
|
||||||
|
@ -148,7 +148,7 @@ class Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows setting of multiple properties of the object in a single line of code. Will only set
|
* Allows setting of multiple properties of the object in a single line of code. Will only set
|
||||||
* properties that are part of a class declaration.
|
* properties that are part of a class declaration.
|
||||||
*
|
*
|
||||||
* @param array $properties An associative array containing properties and corresponding values.
|
* @param array $properties An associative array containing properties and corresponding values.
|
||||||
|
@ -213,7 +213,7 @@ class Object {
|
||||||
foreach ($properties as $var) {
|
foreach ($properties as $var) {
|
||||||
if (
|
if (
|
||||||
isset($classProperties[$var]) &&
|
isset($classProperties[$var]) &&
|
||||||
!empty($classProperties[$var]) &&
|
!empty($classProperties[$var]) &&
|
||||||
is_array($this->{$var}) &&
|
is_array($this->{$var}) &&
|
||||||
$this->{$var} != $classProperties[$var]
|
$this->{$var} != $classProperties[$var]
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ class AclBehavior extends ModelBehavior {
|
||||||
|
|
||||||
$types = $this->__typeMaps[$this->settings[$model->name]['type']];
|
$types = $this->__typeMaps[$this->settings[$model->name]['type']];
|
||||||
if (!class_exists('AclNode')) {
|
if (!class_exists('AclNode')) {
|
||||||
require LIBS . 'model' . DS . 'db_acl.php';
|
require CAKE . 'model' . DS . 'db_acl.php';
|
||||||
}
|
}
|
||||||
if (!is_array($types)) {
|
if (!is_array($types)) {
|
||||||
$types = array($types);
|
$types = array($types);
|
||||||
|
|
|
@ -34,7 +34,7 @@ class BasicsTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'locales' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
|
'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
|
||||||
));
|
));
|
||||||
$this->_language = Configure::read('Config.language');
|
$this->_language = Configure::read('Config.language');
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ class BasicsTest extends CakeTestCase {
|
||||||
$string = '<foo> & ';
|
$string = '<foo> & ';
|
||||||
$result = h($string, false);
|
$result = h($string, false);
|
||||||
$this->assertEqual('<foo> & ', $result);
|
$this->assertEqual('<foo> & ', $result);
|
||||||
|
|
||||||
$string = '<foo> & ';
|
$string = '<foo> & ';
|
||||||
$result = h($string, 'UTF-8');
|
$result = h($string, 'UTF-8');
|
||||||
$this->assertEqual('<foo> & &nbsp;', $result);
|
$this->assertEqual('<foo> & &nbsp;', $result);
|
||||||
|
@ -226,7 +226,7 @@ class BasicsTest extends CakeTestCase {
|
||||||
' '
|
' '
|
||||||
);
|
);
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$arr = array('f' => '<foo>', 'n' => ' ');
|
$arr = array('f' => '<foo>', 'n' => ' ');
|
||||||
$result = h($arr, false);
|
$result = h($arr, false);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
|
|
@ -89,8 +89,8 @@ class CacheTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testConfigWithLibAndPluginEngines() {
|
function testConfigWithLibAndPluginEngines() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'Lib' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
|
|
||||||
|
@ -252,8 +252,8 @@ class CacheTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testDrop() {
|
function testDrop() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'libs' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
), true);
|
), true);
|
||||||
|
|
||||||
$result = Cache::drop('some_config_that_does_not_exist');
|
$result = Cache::drop('some_config_that_does_not_exist');
|
||||||
|
@ -305,10 +305,10 @@ class CacheTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testWriteTriggerError() {
|
function testWriteTriggerError() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'libs' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
), true);
|
), true);
|
||||||
|
|
||||||
Cache::config('test_trigger', array('engine' => 'TestAppCache', 'prefix' => ''));
|
Cache::config('test_trigger', array('engine' => 'TestAppCache', 'prefix' => ''));
|
||||||
try {
|
try {
|
||||||
Cache::write('fail', 'value', 'test_trigger');
|
Cache::write('fail', 'value', 'test_trigger');
|
||||||
|
@ -400,7 +400,7 @@ class CacheTest extends CakeTestCase {
|
||||||
Cache::config('file_config', array('engine' => 'File', 'prefix' => 'test_file_'));
|
Cache::config('file_config', array('engine' => 'File', 'prefix' => 'test_file_'));
|
||||||
Cache::set(array('duration' => '+1 year'), 'file_config');
|
Cache::set(array('duration' => '+1 year'), 'file_config');
|
||||||
$settings = Cache::settings('file_config');
|
$settings = Cache::settings('file_config');
|
||||||
|
|
||||||
$this->assertEquals('test_file_', $settings['prefix']);
|
$this->assertEquals('test_file_', $settings['prefix']);
|
||||||
$this->assertEquals(strtotime('+1 year') - time(), $settings['duration']);
|
$this->assertEquals(strtotime('+1 year') - time(), $settings['duration']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ class IniReaderTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function setup() {
|
function setup() {
|
||||||
parent::setup();
|
parent::setup();
|
||||||
$this->path = LIBS . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
|
$this->path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -125,4 +125,4 @@ class IniReaderTest extends CakeTestCase {
|
||||||
$config = $reader->read('nested');
|
$config = $reader->read('nested');
|
||||||
$this->assertTrue($config['bools']['test_on']);
|
$this->assertTrue($config['bools']['test_on']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ class PhpReaderTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->path = LIBS . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
|
$this->path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* test reading files
|
* test reading files
|
||||||
|
@ -83,7 +83,7 @@ class PhpReaderTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testReadPluginValue() {
|
function testReadPluginValue() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$reader = new PhpReader($this->path);
|
$reader = new PhpReader($this->path);
|
||||||
|
|
|
@ -82,7 +82,7 @@ class ApiShellTest extends CakeTestCase {
|
||||||
$this->Shell->expects($this->at(2))->method('out')->with($expected);
|
$this->Shell->expects($this->at(2))->method('out')->with($expected);
|
||||||
|
|
||||||
$this->Shell->args = array('controller');
|
$this->Shell->args = array('controller');
|
||||||
$this->Shell->paths['controller'] = LIBS . 'Controller' . DS;
|
$this->Shell->paths['controller'] = CAKE . 'Controller' . DS;
|
||||||
$this->Shell->main();
|
$this->Shell->main();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,10 +41,10 @@ class CommandListTest extends CakeTestCase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(
|
'plugins' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
|
||||||
),
|
),
|
||||||
'Console/Command' => array(
|
'Console/Command' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
|
||||||
)
|
)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
@ -130,7 +130,7 @@ class CommandListTest extends CakeTestCase {
|
||||||
|
|
||||||
$expected = "/\[.*TestPlugin.*\]\n[ ]+example/";
|
$expected = "/\[.*TestPlugin.*\]\n[ ]+example/";
|
||||||
$this->assertPattern($expected, $output);
|
$this->assertPattern($expected, $output);
|
||||||
|
|
||||||
$expected = "/\[.*Core.*\]\n[ ]+acl, api, bake, command_list, console, i18n, schema, testsuite/";
|
$expected = "/\[.*Core.*\]\n[ ]+acl, api, bake, command_list, console, i18n, schema, testsuite/";
|
||||||
$this->assertPattern($expected, $output);
|
$this->assertPattern($expected, $output);
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ class SchemaShellTest extends CakeTestCase {
|
||||||
* @var array
|
* @var array
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public $fixtures = array('core.article', 'core.user', 'core.post', 'core.auth_user', 'core.author',
|
public $fixtures = array('core.article', 'core.user', 'core.post', 'core.auth_user', 'core.author',
|
||||||
'core.comment', 'core.test_plugin_comment'
|
'core.comment', 'core.test_plugin_comment'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ class SchemaShellTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testViewWithPlugins() {
|
public function testViewWithPlugins() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$this->Shell->args = array('TestPlugin.schema');
|
$this->Shell->args = array('TestPlugin.schema');
|
||||||
|
@ -238,7 +238,7 @@ class SchemaShellTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testDumpFileWritingWithPlugins() {
|
public function testDumpFileWritingWithPlugins() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$this->Shell->args = array('TestPlugin.TestPluginApp');
|
$this->Shell->args = array('TestPlugin.TestPluginApp');
|
||||||
|
@ -314,7 +314,7 @@ class SchemaShellTest extends CakeTestCase {
|
||||||
|
|
||||||
$this->Shell->expects($this->at(2))->method('out')
|
$this->Shell->expects($this->at(2))->method('out')
|
||||||
->with(new PHPUnit_Framework_Constraint_PCREMatch('/Schema file:\s[a-z\.]+\sgenerated/'));
|
->with(new PHPUnit_Framework_Constraint_PCREMatch('/Schema file:\s[a-z\.]+\sgenerated/'));
|
||||||
|
|
||||||
$this->Shell->Schema = $this->getMock('CakeSchema');
|
$this->Shell->Schema = $this->getMock('CakeSchema');
|
||||||
$this->Shell->Schema->path = TMP;
|
$this->Shell->Schema->path = TMP;
|
||||||
$this->Shell->Schema->expects($this->once())->method('read')->will($this->returnValue(array('schema data')));
|
$this->Shell->Schema->expects($this->once())->method('read')->will($this->returnValue(array('schema data')));
|
||||||
|
@ -336,7 +336,7 @@ class SchemaShellTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testGenerateWithPlugins() {
|
public function testGenerateWithPlugins() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ class SchemaShellTest extends CakeTestCase {
|
||||||
$this->Shell->create();
|
$this->Shell->create();
|
||||||
|
|
||||||
$db = ConnectionManager::getDataSource('test');
|
$db = ConnectionManager::getDataSource('test');
|
||||||
|
|
||||||
$db->cacheSources = false;
|
$db->cacheSources = false;
|
||||||
$sources = $db->listSources();
|
$sources = $db->listSources();
|
||||||
$this->assertTrue(in_array($db->config['prefix'] . 'i18n', $sources));
|
$this->assertTrue(in_array($db->config['prefix'] . 'i18n', $sources));
|
||||||
|
@ -439,7 +439,7 @@ class SchemaShellTest extends CakeTestCase {
|
||||||
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
|
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
|
||||||
$this->Shell->expects($this->once())->method('__run')
|
$this->Shell->expects($this->once())->method('__run')
|
||||||
->with($this->arrayHasKey('articles'), 'update', $this->isInstanceOf('CakeSchema'));
|
->with($this->arrayHasKey('articles'), 'update', $this->isInstanceOf('CakeSchema'));
|
||||||
|
|
||||||
$this->Shell->update();
|
$this->Shell->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -450,7 +450,7 @@ class SchemaShellTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testPluginParam() {
|
public function testPluginParam() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$this->Shell->params = array(
|
$this->Shell->params = array(
|
||||||
|
@ -458,7 +458,7 @@ class SchemaShellTest extends CakeTestCase {
|
||||||
'connection' => 'test'
|
'connection' => 'test'
|
||||||
);
|
);
|
||||||
$this->Shell->startup();
|
$this->Shell->startup();
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Config' . DS . 'Schema';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Config' . DS . 'Schema';
|
||||||
$this->assertEqual($this->Shell->Schema->path, $expected);
|
$this->assertEqual($this->Shell->Schema->path, $expected);
|
||||||
CakePlugin::unload();
|
CakePlugin::unload();
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,17 +57,17 @@ class ShellTestShell extends Shell {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function do_something() {
|
public function do_something() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _secret() {
|
public function _secret() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function no_access() {
|
protected function no_access() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function mergeVars($properties, $class, $normalize = true) {
|
public function mergeVars($properties, $class, $normalize = true) {
|
||||||
return $this->_mergeVars($properties, $class, $normalize);
|
return $this->_mergeVars($properties, $class, $normalize);
|
||||||
}
|
}
|
||||||
|
@ -169,8 +169,8 @@ class ShellTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testInitialize() {
|
public function testInitialize() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
'models' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
|
'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
|
||||||
), true);
|
), true);
|
||||||
|
|
||||||
$this->Shell->uses = array('TestPlugin.TestPluginPost');
|
$this->Shell->uses = array('TestPlugin.TestPluginPost');
|
||||||
|
@ -408,7 +408,7 @@ class ShellTest extends CakeTestCase {
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testLoadTasks() {
|
public function testLoadTasks() {
|
||||||
$this->assertTrue($this->Shell->loadTasks());
|
$this->assertTrue($this->Shell->loadTasks());
|
||||||
|
|
||||||
$this->Shell->tasks = null;
|
$this->Shell->tasks = null;
|
||||||
|
@ -451,9 +451,9 @@ class ShellTest extends CakeTestCase {
|
||||||
$this->Shell->params = array('help' => false);
|
$this->Shell->params = array('help' => false);
|
||||||
$this->Shell->loadTasks();
|
$this->Shell->loadTasks();
|
||||||
$result = $this->Shell->TestApple;
|
$result = $this->Shell->TestApple;
|
||||||
|
|
||||||
$this->Shell->args = array('one', 'two');
|
$this->Shell->args = array('one', 'two');
|
||||||
|
|
||||||
$this->assertSame($this->Shell->args, $result->args);
|
$this->assertSame($this->Shell->args, $result->args);
|
||||||
$this->assertSame($this->Shell->params, $result->params);
|
$this->assertSame($this->Shell->params, $result->params);
|
||||||
}
|
}
|
||||||
|
@ -546,7 +546,7 @@ class ShellTest extends CakeTestCase {
|
||||||
$this->Shell->stdin->expects($this->at(0))
|
$this->Shell->stdin->expects($this->at(0))
|
||||||
->method('read')
|
->method('read')
|
||||||
->will($this->returnValue('n'));
|
->will($this->returnValue('n'));
|
||||||
|
|
||||||
$this->Shell->stdin->expects($this->at(1))
|
$this->Shell->stdin->expects($this->at(1))
|
||||||
->method('read')
|
->method('read')
|
||||||
->will($this->returnValue('y'));
|
->will($this->returnValue('y'));
|
||||||
|
@ -651,11 +651,11 @@ class ShellTest extends CakeTestCase {
|
||||||
function testHasTask() {
|
function testHasTask() {
|
||||||
$this->Shell->tasks = array('Extract', 'DbConfig');
|
$this->Shell->tasks = array('Extract', 'DbConfig');
|
||||||
$this->Shell->loadTasks();
|
$this->Shell->loadTasks();
|
||||||
|
|
||||||
$this->assertTrue($this->Shell->hasTask('extract'));
|
$this->assertTrue($this->Shell->hasTask('extract'));
|
||||||
$this->assertTrue($this->Shell->hasTask('Extract'));
|
$this->assertTrue($this->Shell->hasTask('Extract'));
|
||||||
$this->assertFalse($this->Shell->hasTask('random'));
|
$this->assertFalse($this->Shell->hasTask('random'));
|
||||||
|
|
||||||
$this->assertTrue($this->Shell->hasTask('db_config'));
|
$this->assertTrue($this->Shell->hasTask('db_config'));
|
||||||
$this->assertTrue($this->Shell->hasTask('DbConfig'));
|
$this->assertTrue($this->Shell->hasTask('DbConfig'));
|
||||||
}
|
}
|
||||||
|
@ -749,7 +749,7 @@ class ShellTest extends CakeTestCase {
|
||||||
->with(array('--help'))
|
->with(array('--help'))
|
||||||
->will($this->returnValue(array(array('help' => true), array())));
|
->will($this->returnValue(array(array('help' => true), array())));
|
||||||
$Parser->expects($this->once())->method('help');
|
$Parser->expects($this->once())->method('help');
|
||||||
|
|
||||||
$Shell = $this->getMock('Shell', array('getOptionParser', 'out', 'startup', '_welcome'), array(), '', false);
|
$Shell = $this->getMock('Shell', array('getOptionParser', 'out', 'startup', '_welcome'), array(), '', false);
|
||||||
$Shell->expects($this->once())->method('getOptionParser')
|
$Shell->expects($this->once())->method('getOptionParser')
|
||||||
->will($this->returnValue($Parser));
|
->will($this->returnValue($Parser));
|
||||||
|
|
|
@ -70,7 +70,7 @@ class ExtractTaskTest extends CakeTestCase {
|
||||||
public function testExecute() {
|
public function testExecute() {
|
||||||
$this->Task->interactive = false;
|
$this->Task->interactive = false;
|
||||||
|
|
||||||
$this->Task->params['paths'] = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages';
|
$this->Task->params['paths'] = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . 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')
|
||||||
|
@ -117,7 +117,7 @@ class ExtractTaskTest extends CakeTestCase {
|
||||||
|
|
||||||
$pattern = '/To change its layout, create: APP\/views\/layouts\/default\.ctp\./s';
|
$pattern = '/To change its layout, create: APP\/views\/layouts\/default\.ctp\./s';
|
||||||
$this->assertPattern($pattern, $result);
|
$this->assertPattern($pattern, $result);
|
||||||
|
|
||||||
// extract.ctp
|
// extract.ctp
|
||||||
$pattern = '/\#: (\\\\|\/)extract\.ctp:6\n';
|
$pattern = '/\#: (\\\\|\/)extract\.ctp:6\n';
|
||||||
$pattern .= 'msgid "You have %d new message."\nmsgid_plural "You have %d new messages."/';
|
$pattern .= 'msgid "You have %d new message."\nmsgid_plural "You have %d new messages."/';
|
||||||
|
@ -131,7 +131,7 @@ class ExtractTaskTest extends CakeTestCase {
|
||||||
$pattern .= '\#: (\\\\|\/)home\.ctp:99\n';
|
$pattern .= '\#: (\\\\|\/)home\.ctp:99\n';
|
||||||
$pattern .= 'msgid "Editing this Page"\nmsgstr ""/';
|
$pattern .= 'msgid "Editing this Page"\nmsgstr ""/';
|
||||||
$this->assertPattern($pattern, $result);
|
$this->assertPattern($pattern, $result);
|
||||||
|
|
||||||
$pattern = '/\#: (\\\\|\/)extract\.ctp:17\nmsgid "';
|
$pattern = '/\#: (\\\\|\/)extract\.ctp:17\nmsgid "';
|
||||||
$pattern .= 'Hot features!';
|
$pattern .= 'Hot features!';
|
||||||
$pattern .= '\\\n - No Configuration: Set-up the database and let the magic begin';
|
$pattern .= '\\\n - No Configuration: Set-up the database and let the magic begin';
|
||||||
|
@ -162,7 +162,7 @@ class ExtractTaskTest extends CakeTestCase {
|
||||||
function testExtractWithExclude() {
|
function testExtractWithExclude() {
|
||||||
$this->Task->interactive = false;
|
$this->Task->interactive = false;
|
||||||
|
|
||||||
$this->Task->params['paths'] = LIBS . 'Test' . DS . 'test_app' . DS . 'View';
|
$this->Task->params['paths'] = CAKE . 'Test' . DS . 'test_app' . DS . 'View';
|
||||||
$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';
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ class ExtractTaskTest extends CakeTestCase {
|
||||||
|
|
||||||
$pattern = '/\#: .*extract\.ctp:6\n/';
|
$pattern = '/\#: .*extract\.ctp:6\n/';
|
||||||
$this->assertNotRegExp($pattern, $result);
|
$this->assertNotRegExp($pattern, $result);
|
||||||
|
|
||||||
$pattern = '/\#: .*default\.ctp:26\n/';
|
$pattern = '/\#: .*default\.ctp:26\n/';
|
||||||
$this->assertNotRegExp($pattern, $result);
|
$this->assertNotRegExp($pattern, $result);
|
||||||
}
|
}
|
||||||
|
@ -188,10 +188,10 @@ class ExtractTaskTest extends CakeTestCase {
|
||||||
function testExtractMultiplePaths() {
|
function testExtractMultiplePaths() {
|
||||||
$this->Task->interactive = false;
|
$this->Task->interactive = false;
|
||||||
|
|
||||||
$this->Task->params['paths'] =
|
$this->Task->params['paths'] =
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages,' .
|
CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages,' .
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Posts';
|
CAKE . 'Test' . DS . 'test_app' . DS . 'View' . 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');
|
||||||
$this->Task->expects($this->never())->method('_stop');
|
$this->Task->expects($this->never())->method('_stop');
|
||||||
|
|
|
@ -43,8 +43,8 @@ class ProjectTaskTest extends CakeTestCase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
|
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
|
||||||
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
|
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
|
||||||
|
|
||||||
$this->Task = $this->getMock('ProjectTask',
|
$this->Task = $this->getMock('ProjectTask',
|
||||||
array('in', 'err', 'createFile', '_stop'),
|
array('in', 'err', 'createFile', '_stop'),
|
||||||
array($out, $out, $in)
|
array($out, $out, $in)
|
||||||
);
|
);
|
||||||
|
@ -70,7 +70,7 @@ class ProjectTaskTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _setupTestProject() {
|
protected function _setupTestProject() {
|
||||||
$skel = LIBS . 'Console' . DS . 'templates' . DS . 'skel';
|
$skel = CAKE . 'Console' . DS . 'templates' . DS . 'skel';
|
||||||
$this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y'));
|
$this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y'));
|
||||||
$this->Task->bake($this->Task->path . 'bake_test_app', $skel);
|
$this->Task->bake($this->Task->path . 'bake_test_app', $skel);
|
||||||
}
|
}
|
||||||
|
@ -91,12 +91,12 @@ class ProjectTaskTest extends CakeTestCase {
|
||||||
'Console',
|
'Console',
|
||||||
'Console' . DS . 'Command',
|
'Console' . DS . 'Command',
|
||||||
'Console' . DS . 'Command' . DS . 'Task',
|
'Console' . DS . 'Command' . DS . 'Task',
|
||||||
'Controller',
|
'Controller',
|
||||||
'Model',
|
'Model',
|
||||||
'View',
|
'View',
|
||||||
'View' . DS . 'Helper',
|
'View' . DS . 'Helper',
|
||||||
'Test',
|
'Test',
|
||||||
'Test' . DS . 'Case',
|
'Test' . DS . 'Case',
|
||||||
'Test' . DS . 'Case' . DS . 'Model',
|
'Test' . DS . 'Case' . DS . 'Model',
|
||||||
'Test' . DS . 'Fixture',
|
'Test' . DS . 'Fixture',
|
||||||
'tmp',
|
'tmp',
|
||||||
|
@ -118,21 +118,21 @@ class ProjectTaskTest extends CakeTestCase {
|
||||||
$this->Task->params['empty'] = true;
|
$this->Task->params['empty'] = true;
|
||||||
$this->_setupTestProject();
|
$this->_setupTestProject();
|
||||||
$path = $this->Task->path . 'bake_test_app';
|
$path = $this->Task->path . 'bake_test_app';
|
||||||
|
|
||||||
$empty = array(
|
$empty = array(
|
||||||
'Console' . DS . 'Command' . DS . 'Task',
|
'Console' . DS . 'Command' . DS . 'Task',
|
||||||
'Controller' . DS . 'Component',
|
'Controller' . DS . 'Component',
|
||||||
'Model' . DS . 'Behavior',
|
'Model' . DS . 'Behavior',
|
||||||
'View' . DS . 'Helper',
|
'View' . DS . 'Helper',
|
||||||
'View' . DS . 'Errors',
|
'View' . DS . 'Errors',
|
||||||
'View' . DS . 'Scaffolds',
|
'View' . DS . 'Scaffolds',
|
||||||
'Test' . DS . 'Case' . DS . 'Model',
|
'Test' . DS . 'Case' . DS . 'Model',
|
||||||
'Test' . DS . 'Case' . DS . 'Controller',
|
'Test' . DS . 'Case' . DS . 'Controller',
|
||||||
'Test' . DS . 'Case' . DS . 'View' . DS . 'Helper',
|
'Test' . DS . 'Case' . DS . 'View' . DS . 'Helper',
|
||||||
'Test' . DS . 'Fixture',
|
'Test' . DS . 'Fixture',
|
||||||
'webroot' . DS . 'js'
|
'webroot' . DS . 'js'
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($empty as $dir) {
|
foreach ($empty as $dir) {
|
||||||
$this->assertTrue(is_file($path . DS . $dir . DS . 'empty'), 'Missing empty file in ' . $dir);
|
$this->assertTrue(is_file($path . DS . $dir . DS . 'empty'), 'Missing empty file in ' . $dir);
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,7 @@ class ProjectTaskTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testExecute() {
|
public function testExecute() {
|
||||||
$this->Task->params['skel'] = LIBS . 'Console' . DS. 'templates' . DS . 'skel';
|
$this->Task->params['skel'] = CAKE . 'Console' . DS. 'templates' . DS . 'skel';
|
||||||
$this->Task->params['working'] = TMP . 'tests' . DS;
|
$this->Task->params['working'] = TMP . 'tests' . DS;
|
||||||
|
|
||||||
$path = $this->Task->path . 'bake_test_app';
|
$path = $this->Task->path . 'bake_test_app';
|
||||||
|
@ -281,7 +281,7 @@ class ProjectTaskTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testConsolePath() {
|
function testConsolePath() {
|
||||||
$this->_setupTestProject();
|
$this->_setupTestProject();
|
||||||
|
|
||||||
$path = $this->Task->path . 'bake_test_app' . DS;
|
$path = $this->Task->path . 'bake_test_app' . DS;
|
||||||
$result = $this->Task->consolePath($path);
|
$result = $this->Task->consolePath($path);
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
|
|
|
@ -87,7 +87,7 @@ class TemplateTaskTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testFindingInstalledThemesForBake() {
|
public function testFindingInstalledThemesForBake() {
|
||||||
$consoleLibs = LIBS . 'Console' . DS;
|
$consoleLibs = CAKE . 'Console' . DS;
|
||||||
$this->Task->initialize();
|
$this->Task->initialize();
|
||||||
$this->assertEqual($this->Task->templatePaths['default'], $consoleLibs . 'templates' . DS . 'default' . DS);
|
$this->assertEqual($this->Task->templatePaths['default'], $consoleLibs . 'templates' . DS . 'default' . DS);
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ class TemplateTaskTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testGetThemePath() {
|
public function testGetThemePath() {
|
||||||
$defaultTheme = LIBS . 'Console' . DS . 'templates' . DS . 'default' .DS;
|
$defaultTheme = CAKE . 'Console' . DS . 'templates' . DS . 'default' .DS;
|
||||||
$this->Task->templatePaths = array('default' => $defaultTheme);
|
$this->Task->templatePaths = array('default' => $defaultTheme);
|
||||||
|
|
||||||
$this->Task->expects($this->exactly(1))->method('in')->will($this->returnValue('1'));
|
$this->Task->expects($this->exactly(1))->method('in')->will($this->returnValue('1'));
|
||||||
|
@ -126,7 +126,7 @@ class TemplateTaskTest extends CakeTestCase {
|
||||||
public function testGenerate() {
|
public function testGenerate() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'Console' => array(
|
'Console' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Console' . DS
|
CAKE . 'Test' . 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(
|
||||||
'Console' => array(
|
'Console' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Console' . DS,
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS,
|
||||||
CAKE_CORE_INCLUDE_PATH . DS . 'console' . DS
|
CAKE_CORE_INCLUDE_PATH . DS . 'console' . DS
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
|
@ -242,7 +242,7 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
|
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
|
||||||
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
|
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
|
||||||
|
|
||||||
$this->Task = $this->getMock('TestTask',
|
$this->Task = $this->getMock('TestTask',
|
||||||
array('in', 'err', 'createFile', '_stop', 'isLoadableClass'),
|
array('in', 'err', 'createFile', '_stop', 'isLoadableClass'),
|
||||||
array($out, $out, $in)
|
array($out, $out, $in)
|
||||||
);
|
);
|
||||||
|
@ -542,7 +542,7 @@ class TestTaskTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testInteractiveWithPlugin() {
|
function testInteractiveWithPlugin() {
|
||||||
$testApp = LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS;
|
$testApp = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS;
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array($testApp)
|
'plugins' => array($testApp)
|
||||||
), true);
|
), true);
|
||||||
|
@ -555,8 +555,8 @@ class TestTaskTest extends CakeTestCase {
|
||||||
->will($this->onConsecutiveCalls(
|
->will($this->onConsecutiveCalls(
|
||||||
5, //helper
|
5, //helper
|
||||||
1 //OtherHelper
|
1 //OtherHelper
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->Task->expects($this->once())
|
$this->Task->expects($this->once())
|
||||||
->method('createFile')
|
->method('createFile')
|
||||||
->with($path, $this->anything());
|
->with($path, $this->anything());
|
||||||
|
@ -564,7 +564,7 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$this->Task->stdout->expects($this->at(21))
|
$this->Task->stdout->expects($this->at(21))
|
||||||
->method('write')
|
->method('write')
|
||||||
->with('1. OtherHelperHelper');
|
->with('1. OtherHelperHelper');
|
||||||
|
|
||||||
$this->Task->execute();
|
$this->Task->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,10 +117,10 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(
|
'plugins' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
|
||||||
),
|
),
|
||||||
'Console/Command' => array(
|
'Console/Command' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
|
||||||
)
|
)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
|
@ -119,4 +119,4 @@ class TaskCollectionTest extends CakeTestCase {
|
||||||
$this->assertEquals(array('Extract'), $result, 'loaded tasks is wrong');
|
$this->assertEquals(array('Extract'), $result, 'loaded tasks is wrong');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* @since CakePHP(tm) v 1.2.0.5435
|
* @since CakePHP(tm) v 1.2.0.5435
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
App::uses('AclComponent', 'Controller/Component');
|
App::uses('AclComponent', 'Controller/Component');
|
||||||
App::uses('AclNode', 'Model');
|
App::uses('AclNode', 'Model');
|
||||||
class_exists('AclComponent');
|
class_exists('AclComponent');
|
||||||
|
@ -210,7 +210,7 @@ class AclComponentTest extends CakeTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that construtor throws an exception when Acl.classname is a
|
* test that construtor throws an exception when Acl.classname is a
|
||||||
* non-existant class
|
* non-existant class
|
||||||
*
|
*
|
||||||
* @expectedException CakeException
|
* @expectedException CakeException
|
||||||
|
@ -262,7 +262,7 @@ class IniAclTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testCheck() {
|
function testCheck() {
|
||||||
$iniFile = LIBS . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';
|
$iniFile = CAKE . 'Test' . 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);
|
||||||
|
@ -285,7 +285,7 @@ class IniAclTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testCheckArray() {
|
function testCheckArray() {
|
||||||
$iniFile = LIBS . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';
|
$iniFile = CAKE . 'Test' . 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);
|
||||||
|
|
|
@ -155,7 +155,7 @@ class FormAuthenticateTest extends CakeTestCase {
|
||||||
function testPluginModel() {
|
function testPluginModel() {
|
||||||
Cache::delete('object_map', '_cake_core_');
|
Cache::delete('object_map', '_cake_core_');
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
|
|
||||||
|
@ -164,10 +164,10 @@ class FormAuthenticateTest extends CakeTestCase {
|
||||||
$user['username'] = 'gwoo';
|
$user['username'] = 'gwoo';
|
||||||
$user['password'] = Security::hash(Configure::read('Security.salt') . 'cake');
|
$user['password'] = Security::hash(Configure::read('Security.salt') . 'cake');
|
||||||
$PluginModel->save($user, false);
|
$PluginModel->save($user, false);
|
||||||
|
|
||||||
$this->auth->settings['userModel'] = 'TestPlugin.TestPluginAuthUser';
|
$this->auth->settings['userModel'] = 'TestPlugin.TestPluginAuthUser';
|
||||||
$this->auth->settings['fields']['username'] = 'username';
|
$this->auth->settings['fields']['username'] = 'username';
|
||||||
|
|
||||||
$request = new CakeRequest('posts/index', false);
|
$request = new CakeRequest('posts/index', false);
|
||||||
$request->data = array('TestPluginAuthUser' => array(
|
$request->data = array('TestPluginAuthUser' => array(
|
||||||
'username' => 'gwoo',
|
'username' => 'gwoo',
|
||||||
|
@ -185,4 +185,4 @@ class FormAuthenticateTest extends CakeTestCase {
|
||||||
CakePlugin::unload();
|
CakePlugin::unload();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -887,7 +887,7 @@ class AuthTest extends CakeTestCase {
|
||||||
function testNoRedirectOnLoginAction() {
|
function testNoRedirectOnLoginAction() {
|
||||||
$controller = $this->getMock('Controller');
|
$controller = $this->getMock('Controller');
|
||||||
$controller->methods = array('login');
|
$controller->methods = array('login');
|
||||||
|
|
||||||
$url = '/AuthTest/login';
|
$url = '/AuthTest/login';
|
||||||
$this->Auth->request = $controller->request = new CakeRequest($url);
|
$this->Auth->request = $controller->request = new CakeRequest($url);
|
||||||
$this->Auth->request->addParams(Router::parse($url));
|
$this->Auth->request->addParams(Router::parse($url));
|
||||||
|
@ -951,7 +951,7 @@ class AuthTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testAjaxLogin() {
|
function testAjaxLogin() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
$_SERVER['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest";
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest";
|
||||||
|
|
||||||
|
@ -1127,7 +1127,7 @@ class AuthTest extends CakeTestCase {
|
||||||
$this->Auth->Session->expects($this->once())
|
$this->Auth->Session->expects($this->once())
|
||||||
->method('setFlash')
|
->method('setFlash')
|
||||||
->with('Auth failure', 'custom', array(1), 'auth-key');
|
->with('Auth failure', 'custom', array(1), 'auth-key');
|
||||||
|
|
||||||
$this->Auth->flash = array(
|
$this->Auth->flash = array(
|
||||||
'element' => 'custom',
|
'element' => 'custom',
|
||||||
'params' => array(1),
|
'params' => array(1),
|
||||||
|
@ -1187,6 +1187,6 @@ class AuthTest extends CakeTestCase {
|
||||||
$result = $this->Auth->password('password');
|
$result = $this->Auth->password('password');
|
||||||
$expected = Security::hash('password', null, true);
|
$expected = Security::hash('password', null, true);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,7 +157,7 @@ class EmailComponentTest extends CakeTestCase {
|
||||||
$this->Controller->EmailTest->initialize($this->Controller, array());
|
$this->Controller->EmailTest->initialize($this->Controller, array());
|
||||||
|
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ HTMLBLOC;
|
||||||
*/
|
*/
|
||||||
function testMessageRetrievalWithoutTemplate() {
|
function testMessageRetrievalWithoutTemplate() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->Controller->EmailTest->to = 'postmaster@example.com';
|
$this->Controller->EmailTest->to = 'postmaster@example.com';
|
||||||
|
@ -470,7 +470,7 @@ HTMLBLOC;
|
||||||
*/
|
*/
|
||||||
function testMessageRetrievalWithTemplate() {
|
function testMessageRetrievalWithTemplate() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->Controller->set('value', 22091985);
|
$this->Controller->set('value', 22091985);
|
||||||
|
@ -799,8 +799,8 @@ HTMLBLOC;
|
||||||
|
|
||||||
function testPluginCustomViewClass() {
|
function testPluginCustomViewClass() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->Controller->view = 'TestPlugin.Email';
|
$this->Controller->view = 'TestPlugin.Email';
|
||||||
|
|
|
@ -373,7 +373,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
||||||
$this->RequestHandler->request->expects($this->any())
|
$this->RequestHandler->request->expects($this->any())
|
||||||
->method('accepts')
|
->method('accepts')
|
||||||
->will($this->returnValue(array('application/xml')));
|
->will($this->returnValue(array('application/xml')));
|
||||||
|
|
||||||
$this->RequestHandler->response = $this->getMock('CakeResponse', array('type', 'download', 'charset'));
|
$this->RequestHandler->response = $this->getMock('CakeResponse', array('type', 'download', 'charset'));
|
||||||
$this->RequestHandler->response->expects($this->at(0))
|
$this->RequestHandler->response->expects($this->at(0))
|
||||||
->method('type')
|
->method('type')
|
||||||
|
@ -384,7 +384,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
||||||
$this->RequestHandler->response->expects($this->at(2))
|
$this->RequestHandler->response->expects($this->at(2))
|
||||||
->method('download')
|
->method('download')
|
||||||
->with('myfile.xml');
|
->with('myfile.xml');
|
||||||
|
|
||||||
$this->RequestHandler->renderAs($this->Controller, 'xml', array('attachment' => 'myfile.xml'));
|
$this->RequestHandler->renderAs($this->Controller, 'xml', array('attachment' => 'myfile.xml'));
|
||||||
|
|
||||||
$expected = 'RequestHandlerTest' . DS . 'xml';
|
$expected = 'RequestHandlerTest' . DS . 'xml';
|
||||||
|
@ -417,17 +417,17 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testRespondAsWithAttachment() {
|
function testRespondAsWithAttachment() {
|
||||||
$this->RequestHandler = $this->getMock(
|
$this->RequestHandler = $this->getMock(
|
||||||
'RequestHandlerComponent',
|
'RequestHandlerComponent',
|
||||||
array('_header'),
|
array('_header'),
|
||||||
array(&$this->Controller->Components)
|
array(&$this->Controller->Components)
|
||||||
);
|
);
|
||||||
$this->RequestHandler->response = $this->getMock('CakeResponse', array('type', 'download'));
|
$this->RequestHandler->response = $this->getMock('CakeResponse', array('type', 'download'));
|
||||||
$this->RequestHandler->request = $this->getMock('CakeRequest');
|
$this->RequestHandler->request = $this->getMock('CakeRequest');
|
||||||
|
|
||||||
$this->RequestHandler->request->expects($this->once())
|
$this->RequestHandler->request->expects($this->once())
|
||||||
->method('accepts')
|
->method('accepts')
|
||||||
->will($this->returnValue(array('application/xml')));
|
->will($this->returnValue(array('application/xml')));
|
||||||
|
|
||||||
$this->RequestHandler->response->expects($this->once())->method('download')
|
$this->RequestHandler->response->expects($this->once())->method('download')
|
||||||
->with('myfile.xml');
|
->with('myfile.xml');
|
||||||
$this->RequestHandler->response->expects($this->once())->method('type')
|
$this->RequestHandler->response->expects($this->once())->method('type')
|
||||||
|
@ -547,7 +547,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
||||||
$request->expects($this->once())->method('is')
|
$request->expects($this->once())->method('is')
|
||||||
->with('mobile')
|
->with('mobile')
|
||||||
->will($this->returnValue(true));
|
->will($this->returnValue(true));
|
||||||
|
|
||||||
$this->RequestHandler->request = $request;
|
$this->RequestHandler->request = $request;
|
||||||
$this->assertTrue($this->RequestHandler->isMobile());
|
$this->assertTrue($this->RequestHandler->isMobile());
|
||||||
}
|
}
|
||||||
|
@ -563,7 +563,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
||||||
$request->expects($this->once())->method('is')
|
$request->expects($this->once())->method('is')
|
||||||
->with('ssl')
|
->with('ssl')
|
||||||
->will($this->returnValue(true));
|
->will($this->returnValue(true));
|
||||||
|
|
||||||
$this->RequestHandler->request = $request;
|
$this->RequestHandler->request = $request;
|
||||||
$this->assertTrue($this->RequestHandler->isSsl());
|
$this->assertTrue($this->RequestHandler->isSsl());
|
||||||
}
|
}
|
||||||
|
@ -583,15 +583,15 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
||||||
$request->expects($this->at(1))->method('is')
|
$request->expects($this->at(1))->method('is')
|
||||||
->with('post')
|
->with('post')
|
||||||
->will($this->returnValue(false));
|
->will($this->returnValue(false));
|
||||||
|
|
||||||
$request->expects($this->at(2))->method('is')
|
$request->expects($this->at(2))->method('is')
|
||||||
->with('delete')
|
->with('delete')
|
||||||
->will($this->returnValue(true));
|
->will($this->returnValue(true));
|
||||||
|
|
||||||
$request->expects($this->at(3))->method('is')
|
$request->expects($this->at(3))->method('is')
|
||||||
->with('put')
|
->with('put')
|
||||||
->will($this->returnValue(false));
|
->will($this->returnValue(false));
|
||||||
|
|
||||||
$this->RequestHandler->request = $request;
|
$this->RequestHandler->request = $request;
|
||||||
$this->assertTrue($this->RequestHandler->isGet());
|
$this->assertTrue($this->RequestHandler->isGet());
|
||||||
$this->assertFalse($this->RequestHandler->isPost());
|
$this->assertFalse($this->RequestHandler->isPost());
|
||||||
|
@ -613,7 +613,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = $this->RequestHandler->mapAlias('wap');
|
$result = $this->RequestHandler->mapAlias('wap');
|
||||||
$this->assertEquals('text/vnd.wap.wml', $result);
|
$this->assertEquals('text/vnd.wap.wml', $result);
|
||||||
|
|
||||||
$result = $this->RequestHandler->mapAlias(array('xml', 'js', 'json'));
|
$result = $this->RequestHandler->mapAlias(array('xml', 'js', 'json'));
|
||||||
$expected = array('application/xml', 'text/javascript', 'application/json');
|
$expected = array('application/xml', 'text/javascript', 'application/json');
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
@ -695,7 +695,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testAjaxRedirectAsRequestAction() {
|
function testAjaxRedirectAsRequestAction() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. 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));
|
||||||
|
@ -724,7 +724,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testAjaxRedirectAsRequestActionStillRenderingLayout() {
|
function testAjaxRedirectAsRequestActionStillRenderingLayout() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. 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));
|
||||||
|
|
|
@ -84,7 +84,7 @@ class ComponentCollectionTest extends CakeTestCase {
|
||||||
$result = $this->Components->load('Cookie');
|
$result = $this->Components->load('Cookie');
|
||||||
$this->assertInstanceOf('CookieAliasComponent', $result);
|
$this->assertInstanceOf('CookieAliasComponent', $result);
|
||||||
|
|
||||||
App::build(array('plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
|
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$result = $this->Components->load('SomeOther', array('className' => 'TestPlugin.OtherComponent'));
|
$result = $this->Components->load('SomeOther', array('className' => 'TestPlugin.OtherComponent'));
|
||||||
$this->assertInstanceOf('OtherComponentComponent', $result);
|
$this->assertInstanceOf('OtherComponentComponent', $result);
|
||||||
|
@ -125,7 +125,7 @@ class ComponentCollectionTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testLoadPluginComponent() {
|
function testLoadPluginComponent() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
));
|
));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$result = $this->Components->load('TestPlugin.OtherComponent');
|
$result = $this->Components->load('TestPlugin.OtherComponent');
|
||||||
|
@ -171,4 +171,4 @@ class ComponentCollectionTest extends CakeTestCase {
|
||||||
|
|
||||||
$this->assertSame($controller, $result);
|
$this->assertSame($controller, $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,7 +251,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(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,10 +316,10 @@ class ComponentTest extends CakeTestCase {
|
||||||
$Collection = new ComponentCollection();
|
$Collection = new ComponentCollection();
|
||||||
$Banana = $Collection->load('Banana');
|
$Banana = $Collection->load('Banana');
|
||||||
$Orange = $Collection->load('Orange');
|
$Orange = $Collection->load('Orange');
|
||||||
|
|
||||||
$this->assertSame($Banana, $Orange->Banana, 'Should be references');
|
$this->assertSame($Banana, $Orange->Banana, 'Should be references');
|
||||||
$Banana->testField = 'OrangeField';
|
$Banana->testField = 'OrangeField';
|
||||||
|
|
||||||
$this->assertSame($Banana->testField, $Orange->Banana->testField, 'References are broken');
|
$this->assertSame($Banana->testField, $Orange->Banana->testField, 'References are broken');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -439,9 +439,9 @@ class ControllerTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testLoadModelInPlugins() {
|
function testLoadModelInPlugins() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
'Controller' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Controller' . DS),
|
'Controller' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS),
|
||||||
'Model' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
|
'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
App::uses('TestPluginAppController', 'TestPlugin.Controller');
|
App::uses('TestPluginAppController', 'TestPlugin.Controller');
|
||||||
|
@ -482,7 +482,7 @@ class ControllerTest extends CakeTestCase {
|
||||||
|
|
||||||
unset($Controller);
|
unset($Controller);
|
||||||
|
|
||||||
App::build(array('plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
|
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
|
|
||||||
$Controller = new Controller($request);
|
$Controller = new Controller($request);
|
||||||
|
@ -572,7 +572,7 @@ class ControllerTest extends CakeTestCase {
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
$Controller = new Controller($request);
|
$Controller = new Controller($request);
|
||||||
$Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
$Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||||
|
@ -634,7 +634,7 @@ class ControllerTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testRender() {
|
function testRender() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
), true);
|
), true);
|
||||||
$request = new CakeRequest('controller_posts/index');
|
$request = new CakeRequest('controller_posts/index');
|
||||||
$request->params['action'] = 'index';
|
$request->params['action'] = 'index';
|
||||||
|
@ -680,7 +680,7 @@ class ControllerTest extends CakeTestCase {
|
||||||
function testComponentBeforeRenderChangingViewClass() {
|
function testComponentBeforeRenderChangingViewClass() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(
|
'View' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
||||||
)
|
)
|
||||||
), true);
|
), true);
|
||||||
$Controller = new Controller($this->getMock('CakeRequest'));
|
$Controller = new Controller($this->getMock('CakeRequest'));
|
||||||
|
|
|
@ -45,7 +45,7 @@ class PagesControllerTest extends CakeTestCase {
|
||||||
function testDisplay() {
|
function testDisplay() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(
|
'View' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
$Pages = new PagesController(new CakeRequest(null, false));
|
$Pages = new PagesController(new CakeRequest(null, false));
|
||||||
|
|
|
@ -279,8 +279,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(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,39 +307,39 @@ 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 = LIBS . 'View' . DS . 'scaffolds' . DS . 'index.ctp';
|
$expected = CAKE . 'View' . DS . 'scaffolds' . DS . 'index.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('edit');
|
$result = $ScaffoldView->testGetFilename('edit');
|
||||||
$expected = LIBS . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
|
$expected = CAKE . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('add');
|
$result = $ScaffoldView->testGetFilename('add');
|
||||||
$expected = LIBS . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
|
$expected = CAKE . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('view');
|
$result = $ScaffoldView->testGetFilename('view');
|
||||||
$expected = LIBS . 'View' . DS . 'scaffolds' . DS . 'view.ctp';
|
$expected = CAKE . '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 = LIBS . 'View' . DS . 'scaffolds' . DS . 'index.ctp';
|
$expected = CAKE . '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 = LIBS . 'View' . DS . 'scaffolds' . DS . 'view.ctp';
|
$expected = CAKE . '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 =LIBS . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
|
$expected =CAKE . '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 = LIBS . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
|
$expected = CAKE . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('error');
|
$result = $ScaffoldView->testGetFilename('error');
|
||||||
$expected = LIBS . 'View' . DS . 'errors' . DS . 'scaffold_error.ctp';
|
$expected = CAKE . 'View' . DS . 'errors' . DS . 'scaffold_error.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$Controller = new ScaffoldMockController($this->request);
|
$Controller = new ScaffoldMockController($this->request);
|
||||||
|
@ -349,11 +349,11 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
|
|
||||||
$ScaffoldView = new TestScaffoldView($Controller);
|
$ScaffoldView = new TestScaffoldView($Controller);
|
||||||
$result = $ScaffoldView->testGetFilename('admin_edit');
|
$result = $ScaffoldView->testGetFilename('admin_edit');
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' .DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' .DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('edit');
|
$result = $ScaffoldView->testGetFilename('edit');
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' .DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' .DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$Controller = new ScaffoldMockController($this->request);
|
$Controller = new ScaffoldMockController($this->request);
|
||||||
|
@ -368,12 +368,12 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
|
|
||||||
$ScaffoldView = new TestScaffoldView($Controller);
|
$ScaffoldView = new TestScaffoldView($Controller);
|
||||||
$result = $ScaffoldView->testGetFilename('admin_add');
|
$result = $ScaffoldView->testGetFilename('admin_add');
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin'
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'
|
||||||
. DS .'test_plugin' . DS . 'View' . DS . 'tests' . DS . 'scaffold.form.ctp';
|
. DS .'test_plugin' . DS . 'View' . DS . 'tests' . DS . 'scaffold.form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('add');
|
$result = $ScaffoldView->testGetFilename('add');
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin'
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'
|
||||||
. DS .'test_plugin' . DS . 'View' . DS . 'tests' . DS . 'scaffold.form.ctp';
|
. DS .'test_plugin' . DS . 'View' . DS . 'tests' . DS . 'scaffold.form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
$ScaffoldView = new TestScaffoldView($this->Controller);
|
$ScaffoldView = new TestScaffoldView($this->Controller);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('index');
|
$result = $ScaffoldView->testGetFilename('index');
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . 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);
|
||||||
}
|
}
|
||||||
|
@ -456,7 +456,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
'action' => 'view',
|
'action' => 'view',
|
||||||
);
|
);
|
||||||
$this->Controller->request->addParams($params);
|
$this->Controller->request->addParams($params);
|
||||||
|
|
||||||
//set router.
|
//set router.
|
||||||
Router::reload();
|
Router::reload();
|
||||||
Router::setRequestInfo($this->Controller->request);
|
Router::setRequestInfo($this->Controller->request);
|
||||||
|
|
|
@ -221,22 +221,22 @@ class AppImportTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testCore() {
|
function testCore() {
|
||||||
$model = App::core('Model');
|
$model = App::core('Model');
|
||||||
$this->assertEqual(array(LIBS . 'Model' . DS), $model);
|
$this->assertEqual(array(CAKE . 'Model' . DS), $model);
|
||||||
|
|
||||||
$view = App::core('View');
|
$view = App::core('View');
|
||||||
$this->assertEqual(array(LIBS . 'View' . DS), $view);
|
$this->assertEqual(array(CAKE . 'View' . DS), $view);
|
||||||
|
|
||||||
$controller = App::core('Controller');
|
$controller = App::core('Controller');
|
||||||
$this->assertEqual(array(LIBS . 'Controller' . DS), $controller);
|
$this->assertEqual(array(CAKE . 'Controller' . DS), $controller);
|
||||||
|
|
||||||
$component = App::core('Controller/Component');
|
$component = App::core('Controller/Component');
|
||||||
$this->assertEqual(array(LIBS . 'Controller' . DS . 'Component' . DS), str_replace('/', DS, $component));
|
$this->assertEqual(array(CAKE . 'Controller' . DS . 'Component' . DS), str_replace('/', DS, $component));
|
||||||
|
|
||||||
$auth = App::core('Controller/Component/Auth');
|
$auth = App::core('Controller/Component/Auth');
|
||||||
$this->assertEqual(array(LIBS . 'Controller' . DS . 'Component' . DS . 'Auth' . DS), str_replace('/', DS, $auth));
|
$this->assertEqual(array(CAKE . 'Controller' . DS . 'Component' . DS . 'Auth' . DS), str_replace('/', DS, $auth));
|
||||||
|
|
||||||
$datasource = App::core('Model/Datasource');
|
$datasource = App::core('Model/Datasource');
|
||||||
$this->assertEqual(array(LIBS . 'Model' . DS . 'Datasource' . DS), str_replace('/', DS, $datasource));
|
$this->assertEqual(array(CAKE . 'Model' . DS . 'Datasource' . DS), str_replace('/', DS, $datasource));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -246,7 +246,7 @@ class AppImportTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testListObjects() {
|
function testListObjects() {
|
||||||
$result = App::objects('class', LIBS . 'Routing', false);
|
$result = App::objects('class', CAKE . 'Routing', false);
|
||||||
$this->assertTrue(in_array('Dispatcher', $result));
|
$this->assertTrue(in_array('Dispatcher', $result));
|
||||||
$this->assertTrue(in_array('Router', $result));
|
$this->assertTrue(in_array('Router', $result));
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ class AppImportTest extends CakeTestCase {
|
||||||
|
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(
|
'plugins' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Lib' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
$result = App::objects('plugin', null, false);
|
$result = App::objects('plugin', null, false);
|
||||||
|
@ -317,8 +317,8 @@ class AppImportTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testListObjectsInPlugin() {
|
function testListObjectsInPlugin() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'Model' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
||||||
|
@ -369,16 +369,16 @@ class AppImportTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testPluginPath() {
|
function testPluginPath() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
||||||
$path = App::pluginPath('TestPlugin');
|
$path = App::pluginPath('TestPlugin');
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS;
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS;
|
||||||
$this->assertEqual($path, $expected);
|
$this->assertEqual($path, $expected);
|
||||||
|
|
||||||
$path = App::pluginPath('TestPluginTwo');
|
$path = App::pluginPath('TestPluginTwo');
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPluginTwo' . DS;
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPluginTwo' . DS;
|
||||||
$this->assertEqual($path, $expected);
|
$this->assertEqual($path, $expected);
|
||||||
App::build();
|
App::build();
|
||||||
}
|
}
|
||||||
|
@ -390,14 +390,14 @@ class AppImportTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testThemePath() {
|
function testThemePath() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
|
||||||
));
|
));
|
||||||
$path = App::themePath('test_theme');
|
$path = App::themePath('test_theme');
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS;
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS;
|
||||||
$this->assertEqual($path, $expected);
|
$this->assertEqual($path, $expected);
|
||||||
|
|
||||||
$path = App::themePath('TestTheme');
|
$path = App::themePath('TestTheme');
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS;
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS;
|
||||||
$this->assertEqual($path, $expected);
|
$this->assertEqual($path, $expected);
|
||||||
|
|
||||||
App::build();
|
App::build();
|
||||||
|
@ -490,8 +490,8 @@ class AppImportTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testPluginImporting() {
|
function testPluginImporting() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'libs' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
||||||
|
@ -534,7 +534,7 @@ class AppImportTest extends CakeTestCase {
|
||||||
$this->assertFalse(class_exists('BananaHelper', false), 'BananaHelper exists, cannot test importing it.');
|
$this->assertFalse(class_exists('BananaHelper', false), 'BananaHelper exists, cannot test importing it.');
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View/Helper' => array(
|
'View/Helper' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Helper' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Helper' . DS
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
$this->assertFalse(class_exists('BananaHelper', false), 'BananaHelper exists, cannot test importing it.');
|
$this->assertFalse(class_exists('BananaHelper', false), 'BananaHelper exists, cannot test importing it.');
|
||||||
|
@ -551,10 +551,10 @@ class AppImportTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testFileLoading () {
|
function testFileLoading () {
|
||||||
$file = App::import('File', 'RealFile', false, array(), LIBS . 'Config' . DS . 'config.php');
|
$file = App::import('File', 'RealFile', false, array(), CAKE . 'Config' . DS . 'config.php');
|
||||||
$this->assertTrue($file);
|
$this->assertTrue($file);
|
||||||
|
|
||||||
$file = App::import('File', 'NoFile', false, array(), LIBS . 'Config' . DS . 'cake' . DS . 'config.php');
|
$file = App::import('File', 'NoFile', false, array(), CAKE . 'Config' . DS . 'cake' . DS . 'config.php');
|
||||||
$this->assertFalse($file);
|
$this->assertFalse($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -566,12 +566,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' => LIBS . DS . 'Config' . DS . 'config.php');
|
'file' => CAKE . 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' => LIBS . 'Config' . DS . 'cake' . DS . 'config.php');
|
'file' => CAKE . 'Config' . DS . 'cake' . DS . 'config.php');
|
||||||
$file = App::import($type);
|
$file = App::import($type);
|
||||||
$this->assertFalse($file);
|
$this->assertFalse($file);
|
||||||
}
|
}
|
||||||
|
@ -583,13 +583,13 @@ class AppImportTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testFileLoadingReturnValue () {
|
function testFileLoadingReturnValue () {
|
||||||
$file = App::import('File', 'Name', false, array(), LIBS . 'Config' . DS . 'config.php', true);
|
$file = App::import('File', 'Name', false, array(), CAKE . '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' => LIBS . 'Config' . DS . 'config.php', 'return' => true);
|
'file' => CAKE . 'Config' . DS . 'config.php', 'return' => true);
|
||||||
$file = App::import($type);
|
$file = App::import($type);
|
||||||
$this->assertTrue(!empty($file));
|
$this->assertTrue(!empty($file));
|
||||||
|
|
||||||
|
@ -603,10 +603,10 @@ class AppImportTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testLoadingWithSearch () {
|
function testLoadingWithSearch () {
|
||||||
$file = App::import('File', 'NewName', false, array(LIBS . 'Config' . DS), 'config.php');
|
$file = App::import('File', 'NewName', false, array(CAKE . 'Config' . DS), '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(CAKE), 'config.php');
|
||||||
$this->assertFalse($file);
|
$this->assertFalse($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,7 +622,7 @@ class AppImportTest extends CakeTestCase {
|
||||||
'name' => 'RandomName',
|
'name' => 'RandomName',
|
||||||
'parent' => false,
|
'parent' => false,
|
||||||
'file' => 'config.php',
|
'file' => 'config.php',
|
||||||
'search' => array(LIBS . 'Config' . DS)
|
'search' => array(CAKE . 'Config' . DS)
|
||||||
);
|
);
|
||||||
$file = App::import($type);
|
$file = App::import($type);
|
||||||
$this->assertTrue($file);
|
$this->assertTrue($file);
|
||||||
|
@ -632,7 +632,7 @@ class AppImportTest extends CakeTestCase {
|
||||||
'name' => 'AnotherRandomName',
|
'name' => 'AnotherRandomName',
|
||||||
'parent' => false,
|
'parent' => false,
|
||||||
'file' => 'config.php',
|
'file' => 'config.php',
|
||||||
'search' => array(LIBS)
|
'search' => array(CAKE)
|
||||||
);
|
);
|
||||||
$file = App::import($type);
|
$file = App::import($type);
|
||||||
$this->assertFalse($file);
|
$this->assertFalse($file);
|
||||||
|
@ -649,7 +649,7 @@ class AppImportTest extends CakeTestCase {
|
||||||
$this->markTestSkipped('Cannot test loading of classes that exist.');
|
$this->markTestSkipped('Cannot test loading of classes that exist.');
|
||||||
}
|
}
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'Model' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
|
'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
|
||||||
));
|
));
|
||||||
$toLoad = array('PersisterOne', 'PersisterTwo');
|
$toLoad = array('PersisterOne', 'PersisterTwo');
|
||||||
$load = App::import('Model', $toLoad);
|
$load = App::import('Model', $toLoad);
|
||||||
|
@ -668,8 +668,8 @@ class AppImportTest extends CakeTestCase {
|
||||||
|
|
||||||
function testLoadingVendor() {
|
function testLoadingVendor() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
'vendors' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Vendor'. DS),
|
'vendors' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor'. DS),
|
||||||
), App::RESET);
|
), App::RESET);
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
||||||
|
@ -725,8 +725,8 @@ class AppImportTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testLoadClassInLibs() {
|
public function testLoadClassInLibs() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'libs' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
), App::RESET);
|
), App::RESET);
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ class ConfigureTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = Configure::read('debug');
|
$result = Configure::read('debug');
|
||||||
$this->assertTrue($result >= 0);
|
$this->assertTrue($result >= 0);
|
||||||
|
|
||||||
$result = Configure::read();
|
$result = Configure::read();
|
||||||
$this->assertTrue(is_array($result));
|
$this->assertTrue(is_array($result));
|
||||||
$this->assertTrue(isset($result['debug']));
|
$this->assertTrue(isset($result['debug']));
|
||||||
|
@ -198,7 +198,7 @@ class ConfigureTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testLoadWithMerge() {
|
function testLoadWithMerge() {
|
||||||
Configure::config('test', new PhpReader(LIBS . 'Test' . DS . 'test_app' . DS . 'Config' . DS));
|
Configure::config('test', new PhpReader(CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS));
|
||||||
|
|
||||||
$result = Configure::load('var_test', 'test');
|
$result = Configure::load('var_test', 'test');
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
|
@ -219,7 +219,7 @@ class ConfigureTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testLoadNoMerge() {
|
function testLoadNoMerge() {
|
||||||
Configure::config('test', new PhpReader(LIBS . 'Test' . DS . 'test_app' . DS . 'Config' . DS));
|
Configure::config('test', new PhpReader(CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS));
|
||||||
|
|
||||||
$result = Configure::load('var_test', 'test');
|
$result = Configure::load('var_test', 'test');
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
|
@ -241,7 +241,7 @@ class ConfigureTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testLoadPlugin() {
|
function testLoadPlugin() {
|
||||||
App::build(array('plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)), true);
|
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)), true);
|
||||||
Configure::config('test', new PhpReader());
|
Configure::config('test', new PhpReader());
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$result = Configure::load('TestPlugin.load', 'test');
|
$result = Configure::load('TestPlugin.load', 'test');
|
||||||
|
|
|
@ -471,9 +471,9 @@ class ObjectTest extends CakeTestCase {
|
||||||
Configure::write('Cache.disable', false);
|
Configure::write('Cache.disable', false);
|
||||||
|
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'models' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin'. DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'. DS),
|
||||||
'behaviors' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model'. DS . 'Behavior' . DS),
|
'behaviors' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model'. DS . 'Behavior' . DS),
|
||||||
), true);
|
), true);
|
||||||
|
|
||||||
$this->assertFalse(class_exists('PersisterOneBehaviorBehavior'));
|
$this->assertFalse(class_exists('PersisterOneBehaviorBehavior'));
|
||||||
|
@ -532,8 +532,8 @@ class ObjectTest extends CakeTestCase {
|
||||||
$this->assertFalse(class_exists('ContainableBehavior'));
|
$this->assertFalse(class_exists('ContainableBehavior'));
|
||||||
|
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'models' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
||||||
'behaviors' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model'. DS . 'Behavior' . DS),
|
'behaviors' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model'. DS . 'Behavior' . DS),
|
||||||
), true);
|
), true);
|
||||||
|
|
||||||
$this->assertFalse(class_exists('PersistOneBehaviorBehavior'));
|
$this->assertFalse(class_exists('PersistOneBehaviorBehavior'));
|
||||||
|
@ -676,9 +676,9 @@ class ObjectTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testRequestAction() {
|
function testRequestAction() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'models' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
||||||
'views' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
'views' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
||||||
'controllers' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Controller' . DS)
|
'controllers' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS)
|
||||||
));
|
));
|
||||||
$result = $this->object->requestAction('');
|
$result = $this->object->requestAction('');
|
||||||
$this->assertFalse($result);
|
$this->assertFalse($result);
|
||||||
|
@ -716,11 +716,11 @@ class ObjectTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testRequestActionPlugins() {
|
function testRequestActionPlugins() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
Router::reload();
|
Router::reload();
|
||||||
|
|
||||||
$result = $this->object->requestAction('/test_plugin/tests/index', array('return'));
|
$result = $this->object->requestAction('/test_plugin/tests/index', array('return'));
|
||||||
$expected = 'test plugin index';
|
$expected = 'test plugin index';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
@ -744,7 +744,7 @@ class ObjectTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$expected = 25;
|
$expected = 25;
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
App::build();
|
App::build();
|
||||||
CakePlugin::unload();
|
CakePlugin::unload();
|
||||||
}
|
}
|
||||||
|
@ -756,10 +756,10 @@ class ObjectTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testRequestActionArray() {
|
function testRequestActionArray() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'models' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
||||||
'views' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
'views' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
||||||
'controllers' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Controller' . DS),
|
'controllers' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin'. DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'. DS)
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
||||||
|
@ -770,7 +770,7 @@ class ObjectTest extends CakeTestCase {
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$result = $this->object->requestAction(
|
$result = $this->object->requestAction(
|
||||||
array('controller' => 'request_action', 'action' => 'another_ra_test'),
|
array('controller' => 'request_action', 'action' => 'another_ra_test'),
|
||||||
array('pass' => array('5', '7'))
|
array('pass' => array('5', '7'))
|
||||||
);
|
);
|
||||||
$expected = 12;
|
$expected = 12;
|
||||||
|
@ -824,7 +824,7 @@ class ObjectTest extends CakeTestCase {
|
||||||
$this->assertEqual($result['named'], $expected);
|
$this->assertEqual($result['named'], $expected);
|
||||||
|
|
||||||
$result = $this->object->requestAction(
|
$result = $this->object->requestAction(
|
||||||
array('controller' => 'request_action', 'action' => 'params_pass'),
|
array('controller' => 'request_action', 'action' => 'params_pass'),
|
||||||
array('named' => array('sort' => 'desc', 'limit' => 5))
|
array('named' => array('sort' => 'desc', 'limit' => 5))
|
||||||
);
|
);
|
||||||
$this->assertEqual($result['named'], $expected);
|
$this->assertEqual($result['named'], $expected);
|
||||||
|
|
|
@ -37,7 +37,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
||||||
function setUp() {
|
function setUp() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(
|
'View' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
||||||
)
|
)
|
||||||
), true);
|
), true);
|
||||||
Router::reload();
|
Router::reload();
|
||||||
|
@ -230,7 +230,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
||||||
function testLoadPluginHanlder() {
|
function testLoadPluginHanlder() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(
|
'plugins' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
|
||||||
)
|
)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
|
|
|
@ -158,7 +158,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
||||||
function setUp() {
|
function setUp() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'views' => array(
|
'views' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
||||||
)
|
)
|
||||||
), true);
|
), true);
|
||||||
Router::reload();
|
Router::reload();
|
||||||
|
@ -203,7 +203,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testSubclassMethodsNotBeingConvertedToError() {
|
function testSubclassMethodsNotBeingConvertedToError() {
|
||||||
Configure::write('debug', 2);
|
Configure::write('debug', 2);
|
||||||
|
|
||||||
$exception = new MissingWidgetThingException('Widget not found');
|
$exception = new MissingWidgetThingException('Widget not found');
|
||||||
$ExceptionRenderer = $this->_mockResponse(new MyCustomExceptionRenderer($exception));
|
$ExceptionRenderer = $this->_mockResponse(new MyCustomExceptionRenderer($exception));
|
||||||
|
|
||||||
|
@ -240,10 +240,10 @@ class ExceptionRendererTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testSubclassConvertingFrameworkErrors() {
|
function testSubclassConvertingFrameworkErrors() {
|
||||||
Configure::write('debug', 0);
|
Configure::write('debug', 0);
|
||||||
|
|
||||||
$exception = new MissingControllerException('PostsController');
|
$exception = new MissingControllerException('PostsController');
|
||||||
$ExceptionRenderer = $this->_mockResponse(new MyCustomExceptionRenderer($exception));
|
$ExceptionRenderer = $this->_mockResponse(new MyCustomExceptionRenderer($exception));
|
||||||
|
|
||||||
$this->assertEqual('error400', $ExceptionRenderer->method);
|
$this->assertEqual('error400', $ExceptionRenderer->method);
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
|
@ -34,8 +34,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(LIBS . 'Test' . DS . 'test_app' . DS . 'Locale' . DS),
|
'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ class I18nTest extends CakeTestCase {
|
||||||
$this->assertEqual($cachedDom2['LC_MESSAGES']['dom2.foo'], 'Dom 2 Foo');
|
$this->assertEqual($cachedDom2['LC_MESSAGES']['dom2.foo'], 'Dom 2 Foo');
|
||||||
$this->assertEqual($cachedDom2['LC_MESSAGES']['dom2.bar'], 'Dom 2 Bar');
|
$this->assertEqual($cachedDom2['LC_MESSAGES']['dom2.bar'], 'Dom 2 Bar');
|
||||||
|
|
||||||
// modify cache entry manually to verify that dom1 entries now will be read from cache
|
// modify cache entry manually to verify that dom1 entries now will be read from cache
|
||||||
$cachedDom1['LC_MESSAGES']['dom1.foo'] = 'FOO';
|
$cachedDom1['LC_MESSAGES']['dom1.foo'] = 'FOO';
|
||||||
Cache::write('dom1_' . $lang, $cachedDom1, '_cake_core_');
|
Cache::write('dom1_' . $lang, $cachedDom1, '_cake_core_');
|
||||||
$this->assertEqual(I18n::translate('dom1.foo', false, 'dom1'), 'FOO');
|
$this->assertEqual(I18n::translate('dom1.foo', false, 'dom1'), 'FOO');
|
||||||
|
@ -2432,7 +2432,7 @@ class I18nTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testPluginTranslation() {
|
function testPluginTranslation() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
|
|
||||||
Configure::write('Config.language', 'po');
|
Configure::write('Config.language', 'po');
|
||||||
|
@ -2649,9 +2649,9 @@ class I18nTest extends CakeTestCase {
|
||||||
function testTimeDefinitionJapanese(){
|
function testTimeDefinitionJapanese(){
|
||||||
Configure::write('Config.language', 'ja_jp');
|
Configure::write('Config.language', 'ja_jp');
|
||||||
$result = __c('d_fmt', 5);
|
$result = __c('d_fmt', 5);
|
||||||
|
|
||||||
$expected = "%Y年%m月%d日";
|
$expected = "%Y年%m月%d日";
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$result = __c('am_pm', 5);
|
$result = __c('am_pm', 5);
|
||||||
|
|
|
@ -47,8 +47,8 @@ class CakeLogTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testImportingLoggers() {
|
function testImportingLoggers() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'libs' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
|
|
||||||
|
|
|
@ -345,11 +345,11 @@ class Test2Behavior extends TestBehavior {
|
||||||
public $mapMethods = array('/mappingRobot(\w+)/' => 'mapped');
|
public $mapMethods = array('/mappingRobot(\w+)/' => 'mapped');
|
||||||
|
|
||||||
function resolveMethod($model, $stuff) {
|
function resolveMethod($model, $stuff) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapped($model, $method, $query) {
|
function mapped($model, $method, $query) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
||||||
$this->assertEquals($Apple->testMethod(true), 'working');
|
$this->assertEquals($Apple->testMethod(true), 'working');
|
||||||
$this->assertEquals($Apple->Behaviors->dispatchMethod($Apple, 'testMethod'), 'working');
|
$this->assertEquals($Apple->Behaviors->dispatchMethod($Apple, 'testMethod'), 'working');
|
||||||
|
|
||||||
App::build(array('plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
|
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$this->assertTrue($Apple->Behaviors->load('SomeOther', array('className' => 'TestPlugin.TestPluginPersisterOne')));
|
$this->assertTrue($Apple->Behaviors->load('SomeOther', array('className' => 'TestPlugin.TestPluginPersisterOne')));
|
||||||
$this->assertInstanceOf('TestPluginPersisterOneBehavior', $Apple->Behaviors->SomeOther);
|
$this->assertInstanceOf('TestPluginPersisterOneBehavior', $Apple->Behaviors->SomeOther);
|
||||||
|
@ -1141,7 +1141,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
||||||
$Sample = new Sample();
|
$Sample = new Sample();
|
||||||
$Collection = new BehaviorCollection();
|
$Collection = new BehaviorCollection();
|
||||||
$Collection->init('Sample', array('Test', 'Test2'));
|
$Collection->init('Sample', array('Test', 'Test2'));
|
||||||
|
|
||||||
$this->assertTrue($Collection->hasMethod('testMethod'));
|
$this->assertTrue($Collection->hasMethod('testMethod'));
|
||||||
$this->assertTrue($Collection->hasMethod('resolveMethod'));
|
$this->assertTrue($Collection->hasMethod('resolveMethod'));
|
||||||
|
|
||||||
|
|
|
@ -503,7 +503,7 @@ class CakeSchemaTest extends CakeTestCase {
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public $fixtures = array(
|
public $fixtures = array(
|
||||||
'core.post', 'core.tag', 'core.posts_tag', 'core.test_plugin_comment',
|
'core.post', 'core.tag', 'core.posts_tag', 'core.test_plugin_comment',
|
||||||
'core.datatype', 'core.auth_user', 'core.author',
|
'core.datatype', 'core.auth_user', 'core.author',
|
||||||
'core.test_plugin_article', 'core.user', 'core.comment'
|
'core.test_plugin_article', 'core.user', 'core.comment'
|
||||||
);
|
);
|
||||||
|
@ -665,7 +665,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(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
|
|
||||||
|
@ -984,7 +984,7 @@ class CakeSchemaTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testSchemaLoadingFromPlugin() {
|
function testSchemaLoadingFromPlugin() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$Other = $this->Schema->load(array('name' => 'TestPluginApp', 'plugin' => 'TestPlugin'));
|
$Other = $this->Schema->load(array('name' => 'TestPluginApp', 'plugin' => 'TestPlugin'));
|
||||||
|
|
|
@ -80,7 +80,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testGetPluginDataSource() {
|
function testGetPluginDataSource() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$name = 'test_source';
|
$name = 'test_source';
|
||||||
|
@ -102,7 +102,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testGetPluginDataSourceAndPluginDriver() {
|
function testGetPluginDataSourceAndPluginDriver() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$name = 'test_plugin_source_and_driver';
|
$name = 'test_plugin_source_and_driver';
|
||||||
|
@ -126,7 +126,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testGetLocalDataSourceAndPluginDriver() {
|
function testGetLocalDataSourceAndPluginDriver() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::load('TestPlugin');
|
CakePlugin::load('TestPlugin');
|
||||||
$name = 'test_local_source_and_plugin_driver';
|
$name = 'test_local_source_and_plugin_driver';
|
||||||
|
@ -149,9 +149,9 @@ class ConnectionManagerTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testGetPluginDataSourceAndLocalDriver() {
|
function testGetPluginDataSourceAndLocalDriver() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
'Model/Datasource/Database' => array(
|
'Model/Datasource/Database' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS . 'Database' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS . 'Database' . DS
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -272,9 +272,9 @@ class ConnectionManagerTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testConnectionData() {
|
function testConnectionData() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
'Model/Datasource' => array(
|
'Model/Datasource' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
@ -328,7 +328,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
||||||
public function testDrop() {
|
public function testDrop() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'Model/Datasource' => array(
|
'Model/Datasource' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
ConnectionManager::create('droppable', array('datasource' => 'Test2Source'));
|
ConnectionManager::create('droppable', array('datasource' => 'Test2Source'));
|
||||||
|
|
|
@ -23,7 +23,7 @@ class TestCakeSession extends CakeSession {
|
||||||
public static function setUserAgent($value) {
|
public static function setUserAgent($value) {
|
||||||
self::$_userAgent = $value;
|
self::$_userAgent = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setHost($host) {
|
public static function setHost($host) {
|
||||||
self::_setHost($host);
|
self::_setHost($host);
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ class CakeSessionTest extends CakeTestCase {
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testCakeSessionPathEmpty() {
|
function testCakeSessionPathEmpty() {
|
||||||
TestCakeSession::init('');
|
TestCakeSession::init('');
|
||||||
$this->assertEquals(TestCakeSession::$path, '/', 'Session path is empty, with "" as $base needs to be /');
|
$this->assertEquals(TestCakeSession::$path, '/', 'Session path is empty, with "" as $base needs to be /');
|
||||||
|
@ -302,7 +302,7 @@ class CakeSessionTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testId() {
|
function testId() {
|
||||||
TestCakeSession::destroy();
|
TestCakeSession::destroy();
|
||||||
|
|
||||||
$result = TestCakeSession::id();
|
$result = TestCakeSession::id();
|
||||||
$expected = session_id();
|
$expected = session_id();
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
@ -528,7 +528,7 @@ class CakeSessionTest extends CakeTestCase {
|
||||||
function testUsingAppLibsHandler() {
|
function testUsingAppLibsHandler() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'Model/Datasource/Session' => array(
|
'Model/Datasource/Session' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS . 'Session' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS . 'Session' . DS
|
||||||
),
|
),
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
), true);
|
), true);
|
||||||
|
@ -553,14 +553,14 @@ class CakeSessionTest extends CakeTestCase {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
), true);
|
), true);
|
||||||
|
|
||||||
Configure::write('Session', array(
|
Configure::write('Session', array(
|
||||||
'defaults' => 'cake',
|
'defaults' => 'cake',
|
||||||
'handler' => array(
|
'handler' => array(
|
||||||
'engine' => 'TestPlugin.TestPluginSession'
|
'engine' => 'TestPlugin.TestPluginSession'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
TestCakeSession::destroy();
|
TestCakeSession::destroy();
|
||||||
$this->assertTrue(TestCakeSession::started());
|
$this->assertTrue(TestCakeSession::started());
|
||||||
|
|
||||||
|
@ -611,7 +611,7 @@ class CakeSessionTest extends CakeTestCase {
|
||||||
function testReadAndWriteWithCustomCacheConfig() {
|
function testReadAndWriteWithCustomCacheConfig() {
|
||||||
Configure::write('Session.defaults', 'cache');
|
Configure::write('Session.defaults', 'cache');
|
||||||
Configure::write('Session.handler.config', 'session_test');
|
Configure::write('Session.handler.config', 'session_test');
|
||||||
|
|
||||||
Cache::config('session_test', array(
|
Cache::config('session_test', array(
|
||||||
'engine' => 'File',
|
'engine' => 'File',
|
||||||
'prefix' => 'session_test_',
|
'prefix' => 'session_test_',
|
||||||
|
@ -663,7 +663,7 @@ class CakeSessionTest extends CakeTestCase {
|
||||||
|
|
||||||
TestCakeSession::destroy();
|
TestCakeSession::destroy();
|
||||||
$this->assertNull(TestCakeSession::read('SessionTestCase'));
|
$this->assertNull(TestCakeSession::read('SessionTestCase'));
|
||||||
|
|
||||||
Configure::write('Session', array(
|
Configure::write('Session', array(
|
||||||
'defaults' => 'php'
|
'defaults' => 'php'
|
||||||
));
|
));
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once LIBS.'Model'.DS.'Model.php';
|
require_once CAKE.'Model'.DS.'Model.php';
|
||||||
require_once LIBS.'Model'.DS.'Datasource'.DS.'DataSource.php';
|
require_once CAKE.'Model'.DS.'Datasource'.DS.'DataSource.php';
|
||||||
require_once LIBS.'Model'.DS.'Datasource'.DS.'DboSource.php';
|
require_once CAKE.'Model'.DS.'Datasource'.DS.'DboSource.php';
|
||||||
require_once LIBS.'Model'.DS.'Datasource'.DS.'Database'.DS.'Mssql.php';
|
require_once CAKE.'Model'.DS.'Datasource'.DS.'Database'.DS.'Mssql.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DboMssqlTestDb class
|
* DboMssqlTestDb class
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once LIBS . 'Model' . DS . 'Datasource' . DS . 'DboSource.php';
|
require_once CAKE . 'Model' . DS . 'Datasource' . DS . 'DboSource.php';
|
||||||
require_once LIBS . 'Model' . DS . 'Datasource' . DS . 'Database' . DS . 'Oracle.php';
|
require_once CAKE . 'Model' . DS . 'Datasource' . DS . 'Database' . DS . 'Oracle.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DboOracleTest class
|
* DboOracleTest class
|
||||||
|
|
|
@ -20,7 +20,7 @@ App::uses('Dispatcher', 'Routing');
|
||||||
App::uses('CakeResponse', 'Network');
|
App::uses('CakeResponse', 'Network');
|
||||||
|
|
||||||
if (!class_exists('AppController', false)) {
|
if (!class_exists('AppController', false)) {
|
||||||
require_once LIBS . 'Controller' . DS . 'AppController.php';
|
require_once CAKE . 'Controller' . DS . 'AppController.php';
|
||||||
} elseif (!defined('APP_CONTROLLER_EXISTS')){
|
} elseif (!defined('APP_CONTROLLER_EXISTS')){
|
||||||
define('APP_CONTROLLER_EXISTS', true);
|
define('APP_CONTROLLER_EXISTS', true);
|
||||||
}
|
}
|
||||||
|
@ -739,7 +739,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$this->assertEquals('Action SomePagesController::home() could not be found.', $e->getMessage());
|
$this->assertEquals('Action SomePagesController::home() could not be found.', $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that methods declared in Controller are treated as missing methods.
|
* test that methods declared in Controller are treated as missing methods.
|
||||||
*
|
*
|
||||||
|
@ -765,7 +765,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testDispatchBasic() {
|
public function testDispatchBasic() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
$Dispatcher = new TestDispatcher();
|
$Dispatcher = new TestDispatcher();
|
||||||
Configure::write('App.baseUrl', '/index.php');
|
Configure::write('App.baseUrl', '/index.php');
|
||||||
|
@ -813,7 +813,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$url = new CakeRequest('test_dispatch_pages/camelCased');
|
$url = new CakeRequest('test_dispatch_pages/camelCased');
|
||||||
$controller = $Dispatcher->dispatch($url, array('return' => 1));
|
$controller = $Dispatcher->dispatch($url, array('return' => 1));
|
||||||
$this->assertEqual('TestDispatchPages', $controller->name);
|
$this->assertEqual('TestDispatchPages', $controller->name);
|
||||||
|
|
||||||
$url = new CakeRequest('test_dispatch_pages/camelCased/something. .');
|
$url = new CakeRequest('test_dispatch_pages/camelCased/something. .');
|
||||||
$controller = $Dispatcher->dispatch($url, array('return' => 1));
|
$controller = $Dispatcher->dispatch($url, array('return' => 1));
|
||||||
$this->assertEqual($controller->params['pass'][0], 'something. .', 'Period was chopped off. %s');
|
$this->assertEqual($controller->params['pass'][0], 'something. .', 'Period was chopped off. %s');
|
||||||
|
@ -857,7 +857,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
Router::reload();
|
Router::reload();
|
||||||
$Dispatcher = new TestDispatcher();
|
$Dispatcher = new TestDispatcher();
|
||||||
Router::connect(
|
Router::connect(
|
||||||
'/my_plugin/:controller/*',
|
'/my_plugin/:controller/*',
|
||||||
array('plugin' => 'my_plugin', 'controller' => 'pages', 'action' => 'display')
|
array('plugin' => 'my_plugin', 'controller' => 'pages', 'action' => 'display')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1042,7 +1042,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
}
|
}
|
||||||
Router::reload();
|
Router::reload();
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
||||||
|
@ -1087,7 +1087,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$Dispatcher->base = false;
|
$Dispatcher->base = false;
|
||||||
|
|
||||||
$url = new CakeRequest('my_plugin/not_here/param:value/param2:value2');
|
$url = new CakeRequest('my_plugin/not_here/param:value/param2:value2');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$controller = $Dispatcher->dispatch($url, array('return'=> 1));
|
$controller = $Dispatcher->dispatch($url, array('return'=> 1));
|
||||||
$this->fail('No exception.');
|
$this->fail('No exception.');
|
||||||
|
@ -1142,7 +1142,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(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
Router::reload();
|
Router::reload();
|
||||||
|
@ -1170,7 +1170,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
|
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
|
||||||
$Dispatcher = new TestDispatcher();
|
$Dispatcher = new TestDispatcher();
|
||||||
$url = new CakeRequest('some_posts/index/param:value/param2:value2');
|
$url = new CakeRequest('some_posts/index/param:value/param2:value2');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$controller = $Dispatcher->dispatch($url, array('return'=> 1));
|
$controller = $Dispatcher->dispatch($url, array('return'=> 1));
|
||||||
$this->fail('No exception.');
|
$this->fail('No exception.');
|
||||||
|
@ -1200,9 +1200,9 @@ class DispatcherTest extends CakeTestCase {
|
||||||
Router::reload();
|
Router::reload();
|
||||||
|
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
'vendors' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Vendor'. DS),
|
'vendors' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor'. DS),
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
||||||
|
@ -1215,7 +1215,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
} catch (MissingControllerException $e) {
|
} catch (MissingControllerException $e) {
|
||||||
$this->assertEquals('Controller class ThemeController could not be found.', $e->getMessage());
|
$this->assertEquals('Controller class ThemeController could not be found.', $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$Dispatcher->dispatch(new CakeRequest('theme/test_theme/pdfs'));
|
$Dispatcher->dispatch(new CakeRequest('theme/test_theme/pdfs'));
|
||||||
$this->fail('No exception');
|
$this->fail('No exception');
|
||||||
|
@ -1227,21 +1227,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(LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'webroot' . DS . 'flash' . DS . 'theme_test.swf');
|
$file = file_get_contents(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . 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(LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'webroot' . DS . 'pdfs' . DS . 'theme_test.pdf');
|
$file = file_get_contents(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . 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(LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'webroot' . DS . 'img' . DS . 'test.jpg');
|
$file = file_get_contents(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'webroot' . DS . 'img' . DS . 'test.jpg');
|
||||||
$this->assertEqual($file, $result);
|
$this->assertEqual($file, $result);
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
@ -1262,20 +1262,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(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'webroot' . DS . 'root.js');
|
$expected = file_get_contents(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . 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(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'webroot' . DS . 'flash' . DS . 'plugin_test.swf');
|
$file = file_get_contents(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . 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(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'webroot' . DS . 'pdfs' . DS . 'plugin_test.pdf');
|
$file = file_get_contents(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . 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);
|
||||||
|
|
||||||
|
@ -1297,7 +1297,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(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' .DS . 'webroot' . DS . 'img' . DS . 'cake.icon.gif');
|
$file = file_get_contents(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' .DS . 'webroot' . DS . 'img' . DS . 'cake.icon.gif');
|
||||||
$this->assertEqual($file, $result);
|
$this->assertEqual($file, $result);
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
@ -1321,7 +1321,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$Dispatcher->asset('test_plugin/css/theme_one.htc');
|
$Dispatcher->asset('test_plugin/css/theme_one.htc');
|
||||||
$result = ob_get_clean();
|
$result = ob_get_clean();
|
||||||
$this->assertEqual('htc file', $result);
|
$this->assertEqual('htc file', $result);
|
||||||
|
|
||||||
if (php_sapi_name() == 'cli') {
|
if (php_sapi_name() == 'cli') {
|
||||||
while (ob_get_level()) {
|
while (ob_get_level()) {
|
||||||
ob_get_clean();
|
ob_get_clean();
|
||||||
|
@ -1348,7 +1348,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that asset filters work for theme and plugin assets
|
* test that asset filters work for theme and plugin assets
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -1368,7 +1368,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$this->assertTrue($Dispatcher->asset('test_plugin/cjs/debug_kit.js'));
|
$this->assertTrue($Dispatcher->asset('test_plugin/cjs/debug_kit.js'));
|
||||||
|
|
||||||
$this->assertFalse($Dispatcher->asset('css/ccss/debug_kit.css'));
|
$this->assertFalse($Dispatcher->asset('css/ccss/debug_kit.css'));
|
||||||
|
|
||||||
$this->assertFalse($Dispatcher->asset('js/cjs/debug_kit.js'));
|
$this->assertFalse($Dispatcher->asset('js/cjs/debug_kit.js'));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -1388,7 +1388,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(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
||||||
), true);
|
), true);
|
||||||
|
|
||||||
$dispatcher = new TestDispatcher();
|
$dispatcher = new TestDispatcher();
|
||||||
|
|
|
@ -631,8 +631,8 @@ class RouterTest extends CakeTestCase {
|
||||||
|
|
||||||
$request = new CakeRequest();
|
$request = new CakeRequest();
|
||||||
$request->addParams(array(
|
$request->addParams(array(
|
||||||
'controller' => 'registrations', 'action' => 'admin_index',
|
'controller' => 'registrations', 'action' => 'admin_index',
|
||||||
'plugin' => null, 'prefix' => 'admin', 'admin' => true,
|
'plugin' => null, 'prefix' => 'admin', 'admin' => true,
|
||||||
'url' => array('ext' => 'html', 'url' => 'admin/registrations/index')
|
'url' => array('ext' => 'html', 'url' => 'admin/registrations/index')
|
||||||
));
|
));
|
||||||
$request->base = '';
|
$request->base = '';
|
||||||
|
@ -647,8 +647,8 @@ class RouterTest extends CakeTestCase {
|
||||||
Router::reload();
|
Router::reload();
|
||||||
$request = new CakeRequest();
|
$request = new CakeRequest();
|
||||||
$request->addParams(array(
|
$request->addParams(array(
|
||||||
'controller' => 'subscriptions', 'action' => 'admin_index',
|
'controller' => 'subscriptions', 'action' => 'admin_index',
|
||||||
'plugin' => null, 'admin' => true,
|
'plugin' => null, 'admin' => true,
|
||||||
'url' => array('url' => 'admin/subscriptions/index/page:2')
|
'url' => array('url' => 'admin/subscriptions/index/page:2')
|
||||||
));
|
));
|
||||||
$request->base = '/magazine';
|
$request->base = '/magazine';
|
||||||
|
@ -688,7 +688,7 @@ class RouterTest extends CakeTestCase {
|
||||||
Router::reload();
|
Router::reload();
|
||||||
$request = new CakeRequest();
|
$request = new CakeRequest();
|
||||||
$request->addParams(array(
|
$request->addParams(array(
|
||||||
'admin' => true, 'action' => 'index', 'plugin' => null, 'controller' => 'users',
|
'admin' => true, 'action' => 'index', 'plugin' => null, 'controller' => 'users',
|
||||||
'url' => array('url' => 'users')
|
'url' => array('url' => 'users')
|
||||||
));
|
));
|
||||||
$request->base = '/';
|
$request->base = '/';
|
||||||
|
@ -743,7 +743,7 @@ class RouterTest extends CakeTestCase {
|
||||||
$request = new CakeRequest();
|
$request = new CakeRequest();
|
||||||
Router::setRequestInfo(
|
Router::setRequestInfo(
|
||||||
$request->addParams(array(
|
$request->addParams(array(
|
||||||
'plugin' => null, 'controller' => 'pages', 'action' => 'admin_edit', 'pass' => array('284'),
|
'plugin' => null, 'controller' => 'pages', 'action' => 'admin_edit', 'pass' => array('284'),
|
||||||
'prefix' => 'admin', 'admin' => true,
|
'prefix' => 'admin', 'admin' => true,
|
||||||
'url' => array('url' => 'admin/pages/edit/284')
|
'url' => array('url' => 'admin/pages/edit/284')
|
||||||
))->addPaths(array(
|
))->addPaths(array(
|
||||||
|
@ -762,7 +762,7 @@ class RouterTest extends CakeTestCase {
|
||||||
$request = new CakeRequest();
|
$request = new CakeRequest();
|
||||||
Router::setRequestInfo(
|
Router::setRequestInfo(
|
||||||
$request->addParams(array(
|
$request->addParams(array(
|
||||||
'plugin' => null, 'controller' => 'pages', 'action' => 'admin_add', 'prefix' => 'admin',
|
'plugin' => null, 'controller' => 'pages', 'action' => 'admin_add', 'prefix' => 'admin',
|
||||||
'admin' => true, 'url' => array('url' => 'admin/pages/add')
|
'admin' => true, 'url' => array('url' => 'admin/pages/add')
|
||||||
))->addPaths(array(
|
))->addPaths(array(
|
||||||
'base' => '', 'here' => '/admin/pages/add', 'webroot' => '/'
|
'base' => '', 'here' => '/admin/pages/add', 'webroot' => '/'
|
||||||
|
@ -780,7 +780,7 @@ class RouterTest extends CakeTestCase {
|
||||||
$request = new CakeRequest();
|
$request = new CakeRequest();
|
||||||
Router::setRequestInfo(
|
Router::setRequestInfo(
|
||||||
$request->addParams(array(
|
$request->addParams(array(
|
||||||
'plugin' => null, 'controller' => 'pages', 'action' => 'admin_edit', 'prefix' => 'admin',
|
'plugin' => null, 'controller' => 'pages', 'action' => 'admin_edit', 'prefix' => 'admin',
|
||||||
'admin' => true, 'pass' => array('284'), 'url' => array('url' => 'admin/pages/edit/284')
|
'admin' => true, 'pass' => array('284'), 'url' => array('url' => 'admin/pages/edit/284')
|
||||||
))->addPaths(array(
|
))->addPaths(array(
|
||||||
'base' => '', 'here' => '/admin/pages/edit/284', 'webroot' => '/'
|
'base' => '', 'here' => '/admin/pages/edit/284', 'webroot' => '/'
|
||||||
|
@ -797,7 +797,7 @@ class RouterTest extends CakeTestCase {
|
||||||
Router::parse('/');
|
Router::parse('/');
|
||||||
Router::setRequestInfo(
|
Router::setRequestInfo(
|
||||||
$request->addParams(array(
|
$request->addParams(array(
|
||||||
'plugin' => null, 'controller' => 'posts', 'action' => 'admin_index', 'prefix' => 'admin',
|
'plugin' => null, 'controller' => 'posts', 'action' => 'admin_index', 'prefix' => 'admin',
|
||||||
'admin' => true, 'pass' => array('284'), 'url' => array('url' => 'admin/posts')
|
'admin' => true, 'pass' => array('284'), 'url' => array('url' => 'admin/posts')
|
||||||
))->addPaths(array(
|
))->addPaths(array(
|
||||||
'base' => '', 'here' => '/admin/posts', 'webroot' => '/'
|
'base' => '', 'here' => '/admin/posts', 'webroot' => '/'
|
||||||
|
@ -1186,7 +1186,7 @@ class RouterTest extends CakeTestCase {
|
||||||
$paths = App::path('plugins');
|
$paths = App::path('plugins');
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(
|
'plugins' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
|
||||||
)
|
)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
@ -1514,7 +1514,7 @@ class RouterTest extends CakeTestCase {
|
||||||
$request = new CakeRequest();
|
$request = new CakeRequest();
|
||||||
Router::setRequestInfo(
|
Router::setRequestInfo(
|
||||||
$request->addParams(array(
|
$request->addParams(array(
|
||||||
'plugin' => null, 'controller' => 'images', 'action' => 'index',
|
'plugin' => null, 'controller' => 'images', 'action' => 'index',
|
||||||
'prefix' => null, 'admin' => false,'url' => array('url' => 'images/index')
|
'prefix' => null, 'admin' => false,'url' => array('url' => 'images/index')
|
||||||
))->addPaths(array(
|
))->addPaths(array(
|
||||||
'base' => '',
|
'base' => '',
|
||||||
|
@ -1582,7 +1582,7 @@ class RouterTest extends CakeTestCase {
|
||||||
$request = new CakeRequest();
|
$request = new CakeRequest();
|
||||||
Router::setRequestInfo(
|
Router::setRequestInfo(
|
||||||
$request->addParams(array(
|
$request->addParams(array(
|
||||||
'plugin' => null, 'controller' => 'images', 'action' => 'index',
|
'plugin' => null, 'controller' => 'images', 'action' => 'index',
|
||||||
'prefix' => null, 'protected' => false, 'url' => array('url' => 'images/index')
|
'prefix' => null, 'protected' => false, 'url' => array('url' => 'images/index')
|
||||||
))->addPaths(array(
|
))->addPaths(array(
|
||||||
'base' => '',
|
'base' => '',
|
||||||
|
@ -1610,7 +1610,7 @@ class RouterTest extends CakeTestCase {
|
||||||
$result = Router::url(array('action' => 'protected_edit', 1, 'protected' => true));
|
$result = Router::url(array('action' => 'protected_edit', 1, 'protected' => true));
|
||||||
$expected = '/protected/images/edit/1';
|
$expected = '/protected/images/edit/1';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$result = Router::url(array('action' => 'protectededit', 1, 'protected' => true));
|
$result = Router::url(array('action' => 'protectededit', 1, 'protected' => true));
|
||||||
$expected = '/protected/images/protectededit/1';
|
$expected = '/protected/images/protectededit/1';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
@ -2211,7 +2211,7 @@ class RouterTest extends CakeTestCase {
|
||||||
function testConnectDefaultRoutes() {
|
function testConnectDefaultRoutes() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(
|
'plugins' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
|
||||||
)
|
)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
|
@ -23,7 +23,7 @@ App::uses('Controller', 'Controller');
|
||||||
App::uses('CakeHtmlReporter', 'TestSuite/Reporter');
|
App::uses('CakeHtmlReporter', 'TestSuite/Reporter');
|
||||||
|
|
||||||
if (!class_exists('AppController', false)) {
|
if (!class_exists('AppController', false)) {
|
||||||
require_once LIBS . 'Controller' . DS . 'AppController.php';
|
require_once CAKE . 'Controller' . DS . 'AppController.php';
|
||||||
} elseif (!defined('APP_CONTROLLER_EXISTS')) {
|
} elseif (!defined('APP_CONTROLLER_EXISTS')) {
|
||||||
define('APP_CONTROLLER_EXISTS', true);
|
define('APP_CONTROLLER_EXISTS', true);
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,8 @@ if (!class_exists('AppController', false)) {
|
||||||
class CakeTestCaseTest extends CakeTestCase {
|
class CakeTestCaseTest extends CakeTestCase {
|
||||||
|
|
||||||
public static function setUpBeforeClass() {
|
public static function setUpBeforeClass() {
|
||||||
require_once LIBS . 'Test' . DS . 'Fixture' . DS . 'AssertTagsTestCase.php';
|
require_once CAKE . 'Test' . DS . 'Fixture' . DS . 'AssertTagsTestCase.php';
|
||||||
require_once LIBS . 'Test' . DS . 'Fixture' . DS . 'FixturizedTestCase.php';
|
require_once CAKE . 'Test' . DS . 'Fixture' . DS . 'FixturizedTestCase.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -122,10 +122,10 @@ class ControllerTestCaseTest extends CakeTestCase {
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
'Controller' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Controller' . DS),
|
'Controller' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS),
|
||||||
'Model' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
$this->Case = new ControllerTestCase();
|
$this->Case = new ControllerTestCase();
|
||||||
|
@ -257,7 +257,7 @@ class ControllerTestCaseTest extends CakeTestCase {
|
||||||
'var' => 'string'
|
'var' => 'string'
|
||||||
);
|
);
|
||||||
$this->assertEquals($expected, $results);
|
$this->assertEquals($expected, $results);
|
||||||
|
|
||||||
$result = $this->Case->controller->response->body();
|
$result = $this->Case->controller->response->body();
|
||||||
$this->assertPattern('/This is the TestsAppsController index view/', $result);
|
$this->assertPattern('/This is the TestsAppsController index view/', $result);
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ class ControllerTestCaseTest extends CakeTestCase {
|
||||||
* Tests using loaded routes during tests
|
* Tests using loaded routes during tests
|
||||||
*/
|
*/
|
||||||
function testUseRoutes() {
|
function testUseRoutes() {
|
||||||
include LIBS . 'Test' . DS . 'test_app' . DS . 'Config' . DS . 'routes.php';
|
include CAKE . 'Test' . 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'));
|
||||||
|
@ -281,19 +281,19 @@ class ControllerTestCaseTest extends CakeTestCase {
|
||||||
$expected = array('cakephp' => 'cool');
|
$expected = array('cakephp' => 'cool');
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($result, $expected);
|
||||||
|
|
||||||
include LIBS . 'Test' . DS . 'test_app' . DS . 'Config' . DS . 'routes.php';
|
include CAKE . 'Test' . 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 LIBS . 'Test' . DS . 'test_app' . DS . 'Config' . DS . 'routes.php';
|
include CAKE . 'Test' . 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 LIBS . 'Test' . DS . 'test_app' . DS . 'Config' . DS . 'routes.php';
|
include CAKE . 'Test' . 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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -302,7 +302,7 @@ class ControllerTestCaseTest extends CakeTestCase {
|
||||||
* @expectedException MissingActionException
|
* @expectedException MissingActionException
|
||||||
*/
|
*/
|
||||||
function testSkipRoutes() {
|
function testSkipRoutes() {
|
||||||
include LIBS . 'Test' . DS . 'test_app' . DS . 'Config' . DS . 'routes.php';
|
include CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS . 'routes.php';
|
||||||
|
|
||||||
$this->Case->loadRoutes = false;
|
$this->Case->loadRoutes = false;
|
||||||
$result = $this->Case->testAction('/tests_apps/missing_action.json', array('return' => 'view'));
|
$result = $this->Case->testAction('/tests_apps/missing_action.json', array('return' => 'view'));
|
||||||
|
@ -459,4 +459,4 @@ class ControllerTestCaseTest extends CakeTestCase {
|
||||||
$this->assertPattern('/<\/html>/', $result);
|
$this->assertPattern('/<\/html>/', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,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(LIBS, $result);
|
$this->assertEquals(CAKE, $result);
|
||||||
|
|
||||||
$this->Coverage->appTest = true;
|
$this->Coverage->appTest = true;
|
||||||
$result = $this->Coverage->getPathFilter();
|
$result = $this->Coverage->getPathFilter();
|
||||||
|
@ -64,7 +64,7 @@ class HtmlCoverageReportTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testFilterCoverageDataByPathRemovingElements() {
|
function testFilterCoverageDataByPathRemovingElements() {
|
||||||
$data = array(
|
$data = array(
|
||||||
LIBS . 'dispatcher.php' => array(
|
CAKE . 'dispatcher.php' => array(
|
||||||
10 => -1,
|
10 => -1,
|
||||||
12 => 1
|
12 => 1
|
||||||
),
|
),
|
||||||
|
@ -74,8 +74,8 @@ class HtmlCoverageReportTest extends CakeTestCase {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->Coverage->setCoverage($data);
|
$this->Coverage->setCoverage($data);
|
||||||
$result = $this->Coverage->filterCoverageDataByPath(LIBS);
|
$result = $this->Coverage->filterCoverageDataByPath(CAKE);
|
||||||
$this->assertTrue(isset($result[LIBS . 'dispatcher.php']));
|
$this->assertTrue(isset($result[CAKE . 'dispatcher.php']));
|
||||||
$this->assertFalse(isset($result[APP . 'app_model.php']));
|
$this->assertFalse(isset($result[APP . 'app_model.php']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,4 +178,4 @@ class HtmlCoverageReportTest extends CakeTestCase {
|
||||||
CakePlugin::unload();
|
CakePlugin::unload();
|
||||||
unset($this->Coverage);
|
unset($this->Coverage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ class FolderTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testOperations() {
|
function testOperations() {
|
||||||
$path = LIBS . 'Console' . DS . 'templates' . DS . 'skel';
|
$path = CAKE . 'Console' . DS . 'templates' . DS . 'skel';
|
||||||
$Folder = new Folder($path);
|
$Folder = new Folder($path);
|
||||||
|
|
||||||
$result = is_dir($Folder->pwd());
|
$result = is_dir($Folder->pwd());
|
||||||
|
@ -220,7 +220,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 = LIBS . 'Console' . DS . 'templates' . DS . 'skel';
|
$path = CAKE . 'Console' . DS . 'templates' . DS . 'skel';
|
||||||
$Folder = new Folder($path);
|
$Folder = new Folder($path);
|
||||||
|
|
||||||
$subdir = 'test_folder_new';
|
$subdir = 'test_folder_new';
|
||||||
|
@ -316,41 +316,41 @@ class FolderTest extends CakeTestCase {
|
||||||
$Folder = new Folder();
|
$Folder = new Folder();
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array(
|
array(
|
||||||
LIBS . 'Config',
|
CAKE . 'Config',
|
||||||
LIBS . 'Config' . DS . 'unicode',
|
CAKE . 'Config' . DS . 'unicode',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding'
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
LIBS . 'Config' . DS . 'config.php',
|
CAKE . 'Config' . DS . 'config.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0080_00ff.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0080_00ff.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0100_017f.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0100_017f.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0180_024F.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0180_024F.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0250_02af.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0250_02af.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0370_03ff.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0370_03ff.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0400_04ff.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0400_04ff.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0500_052f.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0500_052f.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0530_058f.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '0530_058f.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '1e00_1eff.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '1e00_1eff.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '1f00_1fff.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '1f00_1fff.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2100_214f.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2100_214f.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2150_218f.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2150_218f.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2460_24ff.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2460_24ff.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c00_2c5f.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c00_2c5f.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c60_2c7f.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c60_2c7f.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c80_2cff.php',
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c80_2cff.php',
|
||||||
LIBS . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . 'ff00_ffef.php'
|
CAKE . 'Config' . DS . 'unicode' . DS . 'casefolding' . DS . 'ff00_ffef.php'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $Folder->tree(LIBS . 'Config', false);
|
$result = $Folder->tree(CAKE . '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(LIBS . 'Config', false, 'dir');
|
$result = $Folder->tree(CAKE . '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(LIBS . 'Config', false, 'files');
|
$result = $Folder->tree(CAKE . '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());
|
||||||
}
|
}
|
||||||
|
@ -486,7 +486,7 @@ class FolderTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testFind() {
|
function testFind() {
|
||||||
$Folder = new Folder();
|
$Folder = new Folder();
|
||||||
$Folder->cd(LIBS . 'Config');
|
$Folder->cd(CAKE . 'Config');
|
||||||
$result = $Folder->find();
|
$result = $Folder->find();
|
||||||
$expected = array('config.php');
|
$expected = array('config.php');
|
||||||
$this->assertIdentical(array_diff($expected, $result), array());
|
$this->assertIdentical(array_diff($expected, $result), array());
|
||||||
|
@ -539,17 +539,17 @@ class FolderTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testFindRecursive() {
|
function testFindRecursive() {
|
||||||
$Folder = new Folder();
|
$Folder = new Folder();
|
||||||
$Folder->cd(LIBS);
|
$Folder->cd(CAKE);
|
||||||
$result = $Folder->findRecursive('(config|paths)\.php');
|
$result = $Folder->findRecursive('(config|paths)\.php');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
LIBS . 'Config' . DS . 'config.php'
|
CAKE . 'Config' . DS . 'config.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(
|
||||||
LIBS . 'Config' . DS . 'config.php'
|
CAKE . 'Config' . DS . 'config.php'
|
||||||
);
|
);
|
||||||
$this->assertIdentical($result, $expected);
|
$this->assertIdentical($result, $expected);
|
||||||
|
|
||||||
|
@ -583,7 +583,7 @@ class FolderTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$this->assertIdentical($result, $expected);
|
$this->assertIdentical($result, $expected);
|
||||||
|
|
||||||
$Folder->cd(LIBS . 'Config');
|
$Folder->cd(CAKE . 'Config');
|
||||||
$Folder->cd(TMP);
|
$Folder->cd(TMP);
|
||||||
$Folder->delete($Folder->pwd() . DS . 'testme');
|
$Folder->delete($Folder->pwd() . DS . 'testme');
|
||||||
$File->delete();
|
$File->delete();
|
||||||
|
|
|
@ -133,7 +133,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 = LIBS . 'Test' . DS . 'Fixture' . DS . 'sample.xml';
|
$xml = CAKE . 'Test' . DS . 'Fixture' . 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);
|
||||||
|
@ -374,7 +374,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 = LIBS . 'Test' . DS . 'Fixture' . DS . 'sample.xml';
|
$xml = CAKE . 'Test' . DS . 'Fixture' . DS . 'sample.xml';
|
||||||
$obj = Xml::build($xml);
|
$obj = Xml::build($xml);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'tags' => array(
|
'tags' => array(
|
||||||
|
@ -516,7 +516,7 @@ class XmlTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testRss() {
|
public function testRss() {
|
||||||
$rss = file_get_contents(LIBS . 'Test' . DS . 'Fixture' . DS . 'rss.xml');
|
$rss = file_get_contents(CAKE . 'Test' . DS . 'Fixture' . 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);
|
||||||
|
@ -647,7 +647,7 @@ class XmlTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testSoap() {
|
public function testSoap() {
|
||||||
$xmlRequest = Xml::build(LIBS . 'Test' . DS . 'Fixture' . DS . 'soap_request.xml');
|
$xmlRequest = Xml::build(CAKE . 'Test' . DS . 'Fixture' . 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',
|
||||||
|
@ -660,7 +660,7 @@ class XmlTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$this->assertEqual(Xml::toArray($xmlRequest), $expected);
|
$this->assertEqual(Xml::toArray($xmlRequest), $expected);
|
||||||
|
|
||||||
$xmlResponse = Xml::build(LIBS . 'Test' . DS . 'Fixture' . DS . 'soap_response.xml');
|
$xmlResponse = Xml::build(CAKE . 'Test' . DS . 'Fixture' . 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',
|
||||||
|
|
|
@ -84,7 +84,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(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
), true);
|
), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ class CacheHelperTest extends CakeTestCase {
|
||||||
'cache_parsing' => 21600
|
'cache_parsing' => 21600
|
||||||
);
|
);
|
||||||
$this->Controller->request->here = '/cache_test/cache_parsing/1/2/name:mark/ice:cream';
|
$this->Controller->request->here = '/cache_test/cache_parsing/1/2/name:mark/ice:cream';
|
||||||
|
|
||||||
$View = new View($this->Controller);
|
$View = new View($this->Controller);
|
||||||
$result = $View->render('index');
|
$result = $View->render('index');
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ class CacheHelperTest extends CakeTestCase {
|
||||||
function testCacheWithCustomRoutes() {
|
function testCacheWithCustomRoutes() {
|
||||||
Router::reload();
|
Router::reload();
|
||||||
Router::connect('/:lang/:controller/:action/*', array(), array('lang' => '[a-z]{3}'));
|
Router::connect('/:lang/:controller/:action/*', array(), array('lang' => '[a-z]{3}'));
|
||||||
|
|
||||||
$this->Controller->cache_parsing();
|
$this->Controller->cache_parsing();
|
||||||
$this->Controller->request->addParams(array(
|
$this->Controller->request->addParams(array(
|
||||||
'lang' => 'en',
|
'lang' => 'en',
|
||||||
|
@ -520,10 +520,10 @@ class CacheHelperTest extends CakeTestCase {
|
||||||
$Cache->expects($this->once())->method('cache')
|
$Cache->expects($this->once())->method('cache')
|
||||||
->with('posts/index', $View->output, false);
|
->with('posts/index', $View->output, false);
|
||||||
$Cache->afterRender('posts/index');
|
$Cache->afterRender('posts/index');
|
||||||
|
|
||||||
Configure::write('Cache.check', false);
|
Configure::write('Cache.check', false);
|
||||||
$Cache->afterRender('posts/index');
|
$Cache->afterRender('posts/index');
|
||||||
|
|
||||||
Configure::write('Cache.check', true);
|
Configure::write('Cache.check', true);
|
||||||
$View->cacheAction = false;
|
$View->cacheAction = false;
|
||||||
$Cache->afterRender('posts/index');
|
$Cache->afterRender('posts/index');
|
||||||
|
|
|
@ -381,7 +381,7 @@ class HtmlHelperTest extends CakeTestCase {
|
||||||
$file = new File($testfile, true);
|
$file = new File($testfile, true);
|
||||||
|
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'views' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'views' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
Configure::write('Asset.timestamp', true);
|
Configure::write('Asset.timestamp', true);
|
||||||
Configure::write('debug', 1);
|
Configure::write('debug', 1);
|
||||||
|
@ -416,10 +416,10 @@ class HtmlHelperTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testThemeAssetsInMainWebrootPath() {
|
function testThemeAssetsInMainWebrootPath() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'views' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'views' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
$webRoot = Configure::read('App.www_root');
|
$webRoot = Configure::read('App.www_root');
|
||||||
Configure::write('App.www_root', LIBS . 'Test' . DS . 'test_app' . DS . 'webroot' . DS);
|
Configure::write('App.www_root', CAKE . 'Test' . 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');
|
||||||
|
@ -662,7 +662,7 @@ class HtmlHelperTest extends CakeTestCase {
|
||||||
$file = new File($testfile, true);
|
$file = new File($testfile, true);
|
||||||
|
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'views' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'views' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->Html->webroot = '/';
|
$this->Html->webroot = '/';
|
||||||
|
@ -1383,7 +1383,7 @@ class HtmlHelperTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function testLoadConfig() {
|
public function testLoadConfig() {
|
||||||
$path = LIBS . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
|
$path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
|
||||||
|
|
||||||
$result = $this->Html->loadConfig('htmlhelper_tags', $path);
|
$result = $this->Html->loadConfig('htmlhelper_tags', $path);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
@ -1423,7 +1423,7 @@ class HtmlHelperTest extends CakeTestCase {
|
||||||
* @expectedException ConfigureException
|
* @expectedException ConfigureException
|
||||||
*/
|
*/
|
||||||
public function testLoadConfigWrongReader() {
|
public function testLoadConfigWrongReader() {
|
||||||
$path = LIBS . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
|
$path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
|
||||||
$result = $this->Html->loadConfig(array('htmlhelper_tags', 'wrong_reader'), $path);
|
$result = $this->Html->loadConfig(array('htmlhelper_tags', 'wrong_reader'), $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ class SessionHelperTest extends CakeTestCase {
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
$result = $this->Session->flash('notification');
|
$result = $this->Session->flash('notification');
|
||||||
$result = str_replace("\r\n", "\n", $result);
|
$result = str_replace("\r\n", "\n", $result);
|
||||||
|
@ -165,10 +165,10 @@ class SessionHelperTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testFlashElementInAttrs() {
|
function testFlashElementInAttrs() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'views' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'views' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
$result = $this->Session->flash('flash', array(
|
$result = $this->Session->flash('flash', array(
|
||||||
'element' => 'session_helper',
|
'element' => 'session_helper',
|
||||||
'params' => array('title' => 'Notice!', 'name' => 'Alert!')
|
'params' => array('title' => 'Notice!', 'name' => 'Alert!')
|
||||||
));
|
));
|
||||||
$expected = "<div id=\"notificationLayout\">\n\t<h1>Alert!</h1>\n\t<h3>Notice!</h3>\n\t<p>This is a calling</p>\n</div>";
|
$expected = "<div id=\"notificationLayout\">\n\t<h1>Alert!</h1>\n\t<h3>Notice!</h3>\n\t<p>This is a calling</p>\n</div>";
|
||||||
|
|
|
@ -656,7 +656,7 @@ class TimeHelperTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testConvertSpecifiers() {
|
function testConvertSpecifiers() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'locales' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
|
'locales' => array(CAKE . 'Test' . 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');
|
||||||
|
@ -765,7 +765,7 @@ class TimeHelperTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testI18nFormat() {
|
function testI18nFormat() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'locales' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
|
'locales' => array(CAKE . 'Test' . 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');
|
||||||
|
|
|
@ -82,7 +82,7 @@ class HelperCollectionTest extends CakeTestCase {
|
||||||
$result = $this->Helpers->load('Html');
|
$result = $this->Helpers->load('Html');
|
||||||
$this->assertInstanceOf('HtmlAliasHelper', $result);
|
$this->assertInstanceOf('HtmlAliasHelper', $result);
|
||||||
|
|
||||||
App::build(array('plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
|
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
$result = $this->Helpers->load('SomeOther', array('className' => 'TestPlugin.OtherHelper'));
|
$result = $this->Helpers->load('SomeOther', array('className' => 'TestPlugin.OtherHelper'));
|
||||||
$this->assertInstanceOf('OtherHelperHelper', $result);
|
$this->assertInstanceOf('OtherHelperHelper', $result);
|
||||||
|
@ -123,7 +123,7 @@ class HelperCollectionTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testLoadPluginHelper() {
|
function testLoadPluginHelper() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
$result = $this->Helpers->load('TestPlugin.OtherHelper');
|
$result = $this->Helpers->load('TestPlugin.OtherHelper');
|
||||||
|
@ -153,4 +153,4 @@ class HelperCollectionTest extends CakeTestCase {
|
||||||
$this->assertEquals(array('Form'), $result, 'loaded helpers is wrong');
|
$this->assertEquals(array('Form'), $result, 'loaded helpers is wrong');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,10 +172,10 @@ class TestHelper extends Helper {
|
||||||
/**
|
/**
|
||||||
* expose a method as public
|
* expose a method as public
|
||||||
*
|
*
|
||||||
* @param string $options
|
* @param string $options
|
||||||
* @param string $exclude
|
* @param string $exclude
|
||||||
* @param string $insertBefore
|
* @param string $insertBefore
|
||||||
* @param string $insertAfter
|
* @param string $insertAfter
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) {
|
function parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) {
|
||||||
|
@ -518,8 +518,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(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
||||||
|
@ -759,7 +759,7 @@ class HelperTest extends CakeTestCase {
|
||||||
$this->Helper->theme = 'test_theme';
|
$this->Helper->theme = 'test_theme';
|
||||||
|
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
|
|
||||||
$result = $this->Helper->webroot('/img/cake.power.gif');
|
$result = $this->Helper->webroot('/img/cake.power.gif');
|
||||||
|
@ -771,7 +771,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', LIBS . 'Test' . DS . 'test_app' . DS . 'webroot' . DS);
|
Configure::write('App.www_root', CAKE . 'Test' . 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';
|
||||||
|
@ -799,7 +799,7 @@ class HelperTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testLazyLoadingHelpers() {
|
function testLazyLoadingHelpers() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
$Helper = new TestHelper($this->View);
|
$Helper = new TestHelper($this->View);
|
||||||
|
|
|
@ -72,7 +72,7 @@ class MediaViewTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testRender() {
|
function testRender() {
|
||||||
$this->MediaView->viewVars = array(
|
$this->MediaView->viewVars = array(
|
||||||
'path' => LIBS . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS .'css' . DS,
|
'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS .'css' . DS,
|
||||||
'id' => 'test_asset.css',
|
'id' => 'test_asset.css',
|
||||||
'extension' => 'css',
|
'extension' => 'css',
|
||||||
);
|
);
|
||||||
|
@ -120,7 +120,7 @@ class MediaViewTest extends CakeTestCase {
|
||||||
$currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
|
$currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
|
||||||
$_SERVER['HTTP_USER_AGENT'] = 'Some generic browser';
|
$_SERVER['HTTP_USER_AGENT'] = 'Some generic browser';
|
||||||
$this->MediaView->viewVars = array(
|
$this->MediaView->viewVars = array(
|
||||||
'path' => LIBS . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
|
'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
|
||||||
'id' => 'no_section.ini',
|
'id' => 'no_section.ini',
|
||||||
'extension' => 'ini',
|
'extension' => 'ini',
|
||||||
);
|
);
|
||||||
|
@ -180,7 +180,7 @@ class MediaViewTest extends CakeTestCase {
|
||||||
$currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
|
$currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
|
||||||
$_SERVER['HTTP_USER_AGENT'] = 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.8.99 Version/11.10';
|
$_SERVER['HTTP_USER_AGENT'] = 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.8.99 Version/11.10';
|
||||||
$this->MediaView->viewVars = array(
|
$this->MediaView->viewVars = array(
|
||||||
'path' => LIBS . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
|
'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
|
||||||
'id' => 'no_section.ini',
|
'id' => 'no_section.ini',
|
||||||
'extension' => 'ini',
|
'extension' => 'ini',
|
||||||
);
|
);
|
||||||
|
@ -245,7 +245,7 @@ class MediaViewTest extends CakeTestCase {
|
||||||
$currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
|
$currentUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
|
||||||
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)';
|
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)';
|
||||||
$this->MediaView->viewVars = array(
|
$this->MediaView->viewVars = array(
|
||||||
'path' => LIBS . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
|
'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS,
|
||||||
'id' => 'no_section.ini',
|
'id' => 'no_section.ini',
|
||||||
'extension' => 'ini',
|
'extension' => 'ini',
|
||||||
);
|
);
|
||||||
|
@ -308,7 +308,7 @@ class MediaViewTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testConnectionAborted() {
|
function testConnectionAborted() {
|
||||||
$this->MediaView->viewVars = array(
|
$this->MediaView->viewVars = array(
|
||||||
'path' => LIBS . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS .'css' . DS,
|
'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS .'css' . DS,
|
||||||
'id' => 'test_asset.css',
|
'id' => 'test_asset.css',
|
||||||
'extension' => 'css',
|
'extension' => 'css',
|
||||||
);
|
);
|
||||||
|
@ -332,7 +332,7 @@ class MediaViewTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testConnectionAbortedOnBuffering() {
|
function testConnectionAbortedOnBuffering() {
|
||||||
$this->MediaView->viewVars = array(
|
$this->MediaView->viewVars = array(
|
||||||
'path' => LIBS . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS .'css' . DS,
|
'path' => CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS .'css' . DS,
|
||||||
'id' => 'test_asset.css',
|
'id' => 'test_asset.css',
|
||||||
'extension' => 'css',
|
'extension' => 'css',
|
||||||
);
|
);
|
||||||
|
|
|
@ -35,7 +35,7 @@ class ThemePostsController extends Controller {
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public $name = 'ThemePosts';
|
public $name = 'ThemePosts';
|
||||||
|
|
||||||
public $theme = null;
|
public $theme = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -117,8 +117,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(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
'View' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||||
));
|
));
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
}
|
}
|
||||||
|
@ -152,15 +152,15 @@ class ThemeViewTest extends CakeTestCase {
|
||||||
$this->Controller->theme = 'TestTheme';
|
$this->Controller->theme = 'TestTheme';
|
||||||
|
|
||||||
$ThemeView = new TestThemeView($this->Controller);
|
$ThemeView = new TestThemeView($this->Controller);
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugins' . DS . 'TestPlugin' . DS . 'Tests' . DS .'index.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugins' . DS . 'TestPlugin' . DS . 'Tests' . DS .'index.ctp';
|
||||||
$result = $ThemeView->getViewFileName('index');
|
$result = $ThemeView->getViewFileName('index');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugins' . DS . 'TestPlugin' . DS . 'Layouts' . DS .'plugin_default.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugins' . DS . 'TestPlugin' . 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 = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Layouts' . DS .'default.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Layouts' . DS .'default.ctp';
|
||||||
$result = $ThemeView->getLayoutFileName('default');
|
$result = $ThemeView->getLayoutFileName('default');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
@ -180,25 +180,25 @@ class ThemeViewTest extends CakeTestCase {
|
||||||
|
|
||||||
$ThemeView = new TestThemeView($this->Controller);
|
$ThemeView = new TestThemeView($this->Controller);
|
||||||
$ThemeView->theme = 'TestTheme';
|
$ThemeView->theme = 'TestTheme';
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'home.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'home.ctp';
|
||||||
$result = $ThemeView->getViewFileName('home');
|
$result = $ThemeView->getViewFileName('home');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Posts' . DS .'index.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Posts' . DS .'index.ctp';
|
||||||
$result = $ThemeView->getViewFileName('/Posts/index');
|
$result = $ThemeView->getViewFileName('/Posts/index');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Layouts' . DS .'default.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . 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 = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'rss' . DS . 'default.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'rss' . DS . 'default.ctp';
|
||||||
$result = $ThemeView->getLayoutFileName();
|
$result = $ThemeView->getLayoutFileName();
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$ThemeView->layoutPath = 'emails' . DS . 'html';
|
$ThemeView->layoutPath = 'emails' . DS . 'html';
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'emails' . DS . 'html' . DS . 'default.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'emails' . DS . 'html' . DS . 'default.ctp';
|
||||||
$result = $ThemeView->getLayoutFileName();
|
$result = $ThemeView->getLayoutFileName();
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,7 @@ class ViewTest extends CakeTestCase {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||||
'View' => array(
|
'View' => array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
||||||
)
|
)
|
||||||
), true);
|
), true);
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
@ -260,12 +260,12 @@ class ViewTest extends CakeTestCase {
|
||||||
$paths = $View->paths('TestPlugin');
|
$paths = $View->paths('TestPlugin');
|
||||||
$pluginPath = CakePlugin::path('TestPlugin');
|
$pluginPath = CakePlugin::path('TestPlugin');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Plugins' . DS . 'TestPlugin' . DS,
|
CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Plugins' . DS . 'TestPlugin' . DS,
|
||||||
$pluginPath . 'View' . DS,
|
$pluginPath . 'View' . DS,
|
||||||
$pluginPath . 'views' . DS,
|
$pluginPath . 'views' . DS,
|
||||||
$pluginPath . 'Lib' . DS . 'View' . DS,
|
$pluginPath . 'Lib' . DS . 'View' . DS,
|
||||||
LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS,
|
CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS,
|
||||||
LIBS . 'View' . DS
|
CAKE . 'View' . DS
|
||||||
);
|
);
|
||||||
$this->assertEqual($paths, $expected);
|
$this->assertEqual($paths, $expected);
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ class ViewTest extends CakeTestCase {
|
||||||
));
|
));
|
||||||
|
|
||||||
$pluginPath = CakePlugin::path('TestPlugin');
|
$pluginPath = CakePlugin::path('TestPlugin');
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS .'TestPlugin' . DS . 'View' . DS .'Tests' . DS .'index.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS .'TestPlugin' . DS . 'View' . DS .'Tests' . DS .'index.ctp';
|
||||||
$result = $View->getViewFileName('index');
|
$result = $View->getViewFileName('index');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
@ -312,29 +312,29 @@ class ViewTest extends CakeTestCase {
|
||||||
|
|
||||||
$View = new TestView($this->Controller);
|
$View = new TestView($this->Controller);
|
||||||
|
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'home.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'home.ctp';
|
||||||
$result = $View->getViewFileName('home');
|
$result = $View->getViewFileName('home');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
|
||||||
$result = $View->getViewFileName('/Posts/index');
|
$result = $View->getViewFileName('/Posts/index');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
|
||||||
$result = $View->getViewFileName('../Posts/index');
|
$result = $View->getViewFileName('../Posts/index');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS .'default.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . 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 = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'rss' . DS . 'default.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'rss' . DS . 'default.ctp';
|
||||||
$result = $View->getLayoutFileName();
|
$result = $View->getLayoutFileName();
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$View->layoutPath = 'emails' . DS . 'html';
|
$View->layoutPath = 'emails' . DS . 'html';
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'emails' . DS . 'html' . DS . 'default.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'emails' . DS . 'html' . DS . 'default.ctp';
|
||||||
$result = $View->getLayoutFileName();
|
$result = $View->getLayoutFileName();
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
@ -762,7 +762,7 @@ class ViewTest extends CakeTestCase {
|
||||||
$result = $View->getViewFileName('../Themed/TestTheme/Posts/index');
|
$result = $View->getViewFileName('../Themed/TestTheme/Posts/index');
|
||||||
$this->assertPattern('/Themed(\/|\\\)TestTheme(\/|\\\)Posts(\/|\\\)index.ctp/', $result);
|
$this->assertPattern('/Themed(\/|\\\)TestTheme(\/|\\\)Posts(\/|\\\)index.ctp/', $result);
|
||||||
|
|
||||||
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Posts' . DS .'index.ctp';
|
||||||
$result = $View->getViewFileName('../Posts/index');
|
$result = $View->getViewFileName('../Posts/index');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
<?php
|
<?php
|
||||||
if (!empty($filePresent)):
|
if (!empty($filePresent)):
|
||||||
if (!class_exists('ConnectionManager')) {
|
if (!class_exists('ConnectionManager')) {
|
||||||
require LIBS . 'model' . DS . 'connection_manager.php';
|
require CAKE . 'model' . DS . 'connection_manager.php';
|
||||||
}
|
}
|
||||||
$connected = ConnectionManager::getDataSource('default');
|
$connected = ConnectionManager::getDataSource('default');
|
||||||
?>
|
?>
|
||||||
|
@ -138,4 +138,4 @@ if (!empty($filePresent)):
|
||||||
<ul><li><?php echo __d('cake', 'Community mailing list'); ?></li></ul></li>
|
<ul><li><?php echo __d('cake', 'Community mailing list'); ?></li></ul></li>
|
||||||
<li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a>
|
<li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a>
|
||||||
<ul><li><?php echo __d('cake', 'Live chat about CakePHP'); ?></li></ul></li>
|
<ul><li><?php echo __d('cake', 'Live chat about CakePHP'); ?></li></ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('CORE_TEST_CASES', LIBS . 'Test' . DS . 'Case');
|
define('CORE_TEST_CASES', CAKE . 'Test' . DS . 'Case');
|
||||||
define('APP_TEST_CASES', TESTS . 'Case');
|
define('APP_TEST_CASES', TESTS . 'Case');
|
||||||
|
|
||||||
App::uses('CakeTestSuiteCommand', 'TestSuite');
|
App::uses('CakeTestSuiteCommand', 'TestSuite');
|
||||||
|
|
|
@ -45,7 +45,7 @@ abstract class BaseCoverageReport {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of test case file names. Used to do basename() matching with
|
* Array of test case file names. Used to do basename() matching with
|
||||||
* files that have coverage to decide which results to show on page load.
|
* files that have coverage to decide which results to show on page load.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
@ -101,7 +101,7 @@ abstract class BaseCoverageReport {
|
||||||
} elseif ($this->pluginTest) {
|
} elseif ($this->pluginTest) {
|
||||||
$path = App::pluginPath($this->pluginTest);
|
$path = App::pluginPath($this->pluginTest);
|
||||||
} else {
|
} else {
|
||||||
$path = LIBS;
|
$path = CAKE;
|
||||||
}
|
}
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
@ -168,4 +168,4 @@ abstract class BaseCoverageReport {
|
||||||
*/
|
*/
|
||||||
abstract public function generateDiff($filename, $fileLines, $coverageData);
|
abstract public function generateDiff($filename, $fileLines, $coverageData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@ class CakeFixtureManager {
|
||||||
|
|
||||||
if (strpos($fixture, 'core.') === 0) {
|
if (strpos($fixture, 'core.') === 0) {
|
||||||
$fixture = substr($fixture, strlen('core.'));
|
$fixture = substr($fixture, strlen('core.'));
|
||||||
$fixturePaths[] = LIBS . 'Test' . DS . 'Fixture';
|
$fixturePaths[] = CAKE . 'Test' . DS . 'Fixture';
|
||||||
} elseif (strpos($fixture, 'app.') === 0) {
|
} elseif (strpos($fixture, 'app.') === 0) {
|
||||||
$fixture = substr($fixture, strlen('app.'));
|
$fixture = substr($fixture, strlen('app.'));
|
||||||
$fixturePaths = array(
|
$fixturePaths = array(
|
||||||
|
@ -122,7 +122,7 @@ class CakeFixtureManager {
|
||||||
} else {
|
} else {
|
||||||
$fixturePaths = array(
|
$fixturePaths = array(
|
||||||
TESTS . 'Fixture',
|
TESTS . 'Fixture',
|
||||||
LIBS . 'tests' . DS . 'Fixture'
|
CAKE . 'tests' . DS . 'Fixture'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,4 +250,4 @@ class CakeFixtureManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -397,8 +397,8 @@ class Debugger {
|
||||||
} elseif (strpos($path, ROOT) === 0) {
|
} elseif (strpos($path, ROOT) === 0) {
|
||||||
return str_replace(ROOT, 'ROOT', $path);
|
return str_replace(ROOT, 'ROOT', $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($path, LIBS) === 0) {
|
if (strpos($path, CAKE) === 0) {
|
||||||
return str_replace($corePath, 'CORE' . DS, $path);
|
return str_replace($corePath, 'CORE' . DS, $path);
|
||||||
}
|
}
|
||||||
return $path;
|
return $path;
|
||||||
|
@ -565,7 +565,7 @@ class Debugger {
|
||||||
/**
|
/**
|
||||||
* Takes a processed array of data from an error and displays it in the chosen format.
|
* Takes a processed array of data from an error and displays it in the chosen format.
|
||||||
*
|
*
|
||||||
* @param string $data
|
* @param string $data
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function outputError($data) {
|
public function outputError($data) {
|
||||||
|
|
|
@ -80,7 +80,7 @@ class ScaffoldView extends ThemeView {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($name === 'scaffolds' . DS . $subDir . 'error') {
|
if ($name === 'scaffolds' . DS . $subDir . 'error') {
|
||||||
return LIBS . 'View' . DS . 'errors' . DS . 'scaffold_error.ctp';
|
return CAKE . 'View' . DS . 'errors' . DS . 'scaffold_error.ctp';
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new MissingViewException($paths[0] . $name . $this->ext);
|
throw new MissingViewException($paths[0] . $name . $this->ext);
|
||||||
|
|
|
@ -51,7 +51,7 @@ if (!defined('APP')) {
|
||||||
/**
|
/**
|
||||||
* Path to the application's libs directory.
|
* Path to the application's libs directory.
|
||||||
*/
|
*/
|
||||||
define('APPLIBS', APP.'Lib'.DS);
|
define('APPCAKE', APP.'Lib'.DS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Path to the configuration files directory.
|
* Path to the configuration files directory.
|
||||||
|
@ -60,11 +60,6 @@ if (!defined('CONFIGS')) {
|
||||||
define('CONFIGS', APP.'Config'.DS);
|
define('CONFIGS', APP.'Config'.DS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Path to the libs directory.
|
|
||||||
*/
|
|
||||||
define('LIBS', CAKE);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Path to the public CSS directory.
|
* Path to the public CSS directory.
|
||||||
*/
|
*/
|
||||||
|
@ -140,9 +135,9 @@ if (!defined('JS_URL')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
require LIBS . 'basics.php';
|
require CAKE . 'basics.php';
|
||||||
require LIBS . 'Core' . DS .'App.php';
|
require CAKE . 'Core' . DS .'App.php';
|
||||||
require LIBS . 'Error' . DS . 'exceptions.php';
|
require CAKE . 'Error' . DS . 'exceptions.php';
|
||||||
|
|
||||||
spl_autoload_register(array('App', 'load'));
|
spl_autoload_register(array('App', 'load'));
|
||||||
|
|
||||||
|
|
142
lib/Cake/tests/test_app/View/posts/test_nocache_tags.ctp
Normal file
142
lib/Cake/tests/test_app/View/posts/test_nocache_tags.ctp
Normal file
|
@ -0,0 +1,142 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* PHP 5
|
||||||
|
*
|
||||||
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
|
*
|
||||||
|
* Licensed under The MIT License
|
||||||
|
* Redistributions of files must retain the above copyright notice.
|
||||||
|
*
|
||||||
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
|
* @package cake.libs.view.templates.pages
|
||||||
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<p>
|
||||||
|
<!--nocache-->
|
||||||
|
<span class="notice">
|
||||||
|
<?php
|
||||||
|
echo __d('cake', 'Your tmp directory is ');
|
||||||
|
if (is_writable(TMP)):
|
||||||
|
echo __d('cake', 'writable.');
|
||||||
|
else:
|
||||||
|
echo __d('cake', 'NOT writable.');
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</span>
|
||||||
|
<!--/nocache-->
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="notice">
|
||||||
|
<?php
|
||||||
|
echo __d('cake', 'Your cache is ');
|
||||||
|
if (Cache::isInitialized('default')):
|
||||||
|
echo __d('cake', 'set up and initialized properly.');
|
||||||
|
$settings = Cache::settings();
|
||||||
|
echo '<p>' . $settings['engine'];
|
||||||
|
echo __d('cake', ' is being used to cache, to change this edit config/core.php ');
|
||||||
|
echo '</p>';
|
||||||
|
|
||||||
|
echo 'Settings: <ul>';
|
||||||
|
foreach ($settings as $name => $value):
|
||||||
|
echo '<li>' . $name . ': ' . $value . '</li>';
|
||||||
|
endforeach;
|
||||||
|
echo '</ul>';
|
||||||
|
|
||||||
|
else:
|
||||||
|
echo __d('cake', 'NOT working.');
|
||||||
|
echo '<br />';
|
||||||
|
if (is_writable(TMP)):
|
||||||
|
echo __d('cake', 'Edit: config/core.php to insure you have the newset version of this file and the variable $cakeCache set properly');
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="notice">
|
||||||
|
<?php
|
||||||
|
echo __d('cake', 'Your database configuration file is ');
|
||||||
|
$filePresent = null;
|
||||||
|
if (file_exists(CONFIGS.'database.php')):
|
||||||
|
echo __d('cake', 'present.');
|
||||||
|
$filePresent = true;
|
||||||
|
else:
|
||||||
|
echo __d('cake', 'NOT present.');
|
||||||
|
echo '<br/>';
|
||||||
|
echo __d('cake', 'Rename config/database.php.default to config/database.php');
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
<?php
|
||||||
|
if (!empty($filePresent)):
|
||||||
|
if (!class_exists('ConnectionManager')) {
|
||||||
|
require LIBS . 'model' . DS . 'connection_manager.php';
|
||||||
|
}
|
||||||
|
$connected = ConnectionManager::getDataSource('default');
|
||||||
|
?>
|
||||||
|
<p>
|
||||||
|
<span class="notice">
|
||||||
|
<?php
|
||||||
|
__d('cake', 'Cake');
|
||||||
|
if ($connected->isConnected()):
|
||||||
|
__d('cake', ' is able to ');
|
||||||
|
else:
|
||||||
|
__d('cake', ' is NOT able to ');
|
||||||
|
endif;
|
||||||
|
__d('cake', 'connect to the database.');
|
||||||
|
?>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
<h2><?php echo __d('cake', 'Release Notes for CakePHP %s.', Configure::version()); ?></h2>
|
||||||
|
<a href="https://trac.cakephp.org/wiki/notes/1.2.x.x"><?php __d('cake', 'Read the release notes and get the latest version'); ?> </a>
|
||||||
|
<h2><?php __d('cake', 'Editing this Page'); ?></h2>
|
||||||
|
<p>
|
||||||
|
<?php __d('cake', 'To change the content of this page, create: /app/views/pages/home.ctp.'); ?><br />
|
||||||
|
<?php __d('cake', 'To change its layout, create: /app/views/layouts/default.ctp.'); ?><br />
|
||||||
|
<a href="http://manual.cakephp.org/"><?php __d('cake', 'See the views section of the manual for more info.'); ?> </a><br />
|
||||||
|
<?php __d('cake', 'You can also add some CSS styles for your pages at: app/webroot/css/.'); ?>
|
||||||
|
</p>
|
||||||
|
<h2><?php __d('cake', 'Getting Started'); ?></h2>
|
||||||
|
<p>
|
||||||
|
<a href="http://manual.cakephp.org/appendix/blog_tutorial"><?php __d('cake', 'The 15 min Blog Tutorial'); ?></a><br />
|
||||||
|
<a href="http://www-128.ibm.com/developerworks/edu/os-dw-os-php-cake1.html"><?php __d('cake', 'Cook up Web sites fast with CakePHP'); ?></a><br />
|
||||||
|
<a href="http://www-128.ibm.com/developerworks/edu/os-dw-os-php-wiki1.html"><?php __d('cake', 'Create an interactive production wiki using PHP'); ?></a>
|
||||||
|
</p>
|
||||||
|
<h2><?php __d('cake', 'More about Cake'); ?></h2>
|
||||||
|
<p>
|
||||||
|
<?php __d('cake', 'CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.'); ?>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<?php __d('cake', 'Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.'); ?>
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://cakefoundation.org/"><?php __d('cake', 'Cake Software Foundation'); ?> </a>
|
||||||
|
<ul><li><?php __d('cake', 'Promoting development related to CakePHP'); ?></li></ul></li>
|
||||||
|
<li><a href="http://bakery.cakephp.org"><?php __d('cake', 'The Bakery'); ?> </a>
|
||||||
|
<ul><li><?php __d('cake', 'Everything CakePHP'); ?></li></ul></li>
|
||||||
|
<li><a href="http://astore.amazon.com/cakesoftwaref-20/"><?php __d('cake', 'Book Store'); ?> </a>
|
||||||
|
<ul><li><?php __d('cake', 'Recommended Software Books'); ?></li></ul></li>
|
||||||
|
<li><a href="http://www.cafepress.com/cakefoundation"><?php __d('cake', 'CakeSchwag'); ?> </a>
|
||||||
|
<ul><li><?php __d('cake', 'Get your own CakePHP gear - Doughnate to Cake'); ?></li></ul></li>
|
||||||
|
<li><a href="http://www.cakephp.org"><?php __d('cake', 'CakePHP'); ?> </a>
|
||||||
|
<ul><li><?php __d('cake', 'The Rapid Development Framework'); ?></li></ul></li>
|
||||||
|
<li><a href="http://manual.cakephp.org"><?php __d('cake', 'CakePHP Manual'); ?> </a>
|
||||||
|
<ul><li><?php __d('cake', 'Your Rapid Development Cookbook'); ?></li></ul></li>
|
||||||
|
<li><a href="http://api.cakephp.org"><?php __d('cake', 'CakePHP API'); ?> </a>
|
||||||
|
<ul><li><?php __d('cake', 'Docblock Your Best Friend'); ?></li></ul></li>
|
||||||
|
<li><a href="http://www.cakeforge.org"><?php __d('cake', 'CakeForge'); ?> </a>
|
||||||
|
<ul><li><?php __d('cake', 'Open Development for CakePHP'); ?></li></ul></li>
|
||||||
|
<li><a href="https://trac.cakephp.org/"><?php __d('cake', 'CakePHP Trac'); ?> </a>
|
||||||
|
<ul><li><?php __d('cake', 'For the Development of CakePHP (Tickets, SVN browser, Roadmap, Changelogs)'); ?></li></ul></li>
|
||||||
|
<li><a href="http://groups-beta.google.com/group/cake-php"><?php __d('cake', 'CakePHP Google Group'); ?> </a>
|
||||||
|
<ul><li><?php __d('cake', 'Community mailing list'); ?></li></ul></li>
|
||||||
|
<li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a>
|
||||||
|
<ul><li><?php __d('cake', 'Live chat about CakePHP'); ?></li></ul></li>
|
||||||
|
</ul>
|
Loading…
Reference in a new issue