mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-08 12:32:42 +00:00
Adding 'public' visibility to all public methods.
This commit is contained in:
parent
9f9b36830a
commit
438050dcaa
162 changed files with 2234 additions and 2234 deletions
|
@ -523,7 +523,7 @@ class AclShell extends Shell {
|
|||
* @param string $identifier Identifier to parse
|
||||
* @return mixed a string for aliases, and an array for model.foreignKey
|
||||
*/
|
||||
function parseIdentifier($identifier) {
|
||||
public function parseIdentifier($identifier) {
|
||||
if (preg_match('/^([\w]+)\.(.*)$/', $identifier, $matches)) {
|
||||
return array(
|
||||
'model' => $matches[1],
|
||||
|
|
|
@ -245,7 +245,7 @@ class SchemaShell extends Shell {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function create() {
|
||||
public function create() {
|
||||
list($Schema, $table) = $this->_loadSchema();
|
||||
$this->__create($Schema, $table);
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ class SchemaShell extends Shell {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function update() {
|
||||
public function update() {
|
||||
list($Schema, $table) = $this->_loadSchema();
|
||||
$this->__update($Schema, $table);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class PluginTask extends Shell {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function initialize() {
|
||||
public function initialize() {
|
||||
$this->path = current(App::path('plugins'));
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ class ProjectTask extends Shell {
|
|||
* @param string $skip array of directories to skip when copying
|
||||
* @access private
|
||||
*/
|
||||
function bake($path, $skel = null, $skip = array('empty')) {
|
||||
public function bake($path, $skel = null, $skip = array('empty')) {
|
||||
if (!$skel && !empty($this->params['skel'])) {
|
||||
$skel = $this->params['skel'];
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class UpgradeShell extends Shell {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function startup() {
|
||||
public function startup() {
|
||||
parent::startup();
|
||||
if ($this->params['dry-run']) {
|
||||
$this->out('<warning>Dry-run mode enabled!</warning>', 1, Shell::QUIET);
|
||||
|
@ -50,7 +50,7 @@ class UpgradeShell extends Shell {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function all() {
|
||||
public function all() {
|
||||
foreach($this->OptionParser->subcommands() as $command) {
|
||||
$name = $command->name();
|
||||
if ($name === 'all') {
|
||||
|
@ -71,7 +71,7 @@ class UpgradeShell extends Shell {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function locations() {
|
||||
public function locations() {
|
||||
$cwd = getcwd();
|
||||
|
||||
if (is_dir('plugins')) {
|
||||
|
@ -137,7 +137,7 @@ class UpgradeShell extends Shell {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function helpers() {
|
||||
public function helpers() {
|
||||
$this->_paths = array_diff(App::path('views'), App::core('views'));
|
||||
|
||||
if (!empty($this->params['plugin'])) {
|
||||
|
@ -175,7 +175,7 @@ class UpgradeShell extends Shell {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function i18n() {
|
||||
public function i18n() {
|
||||
$this->_paths = array(
|
||||
APP
|
||||
);
|
||||
|
@ -578,7 +578,7 @@ class UpgradeShell extends Shell {
|
|||
*
|
||||
* @return ConsoleOptionParser
|
||||
*/
|
||||
function getOptionParser() {
|
||||
public function getOptionParser() {
|
||||
$subcommandParser = array(
|
||||
'options' => array(
|
||||
'plugin' => array(
|
||||
|
|
|
@ -249,7 +249,7 @@ class ConsoleOutput {
|
|||
* @return mixed If you are getting styles, the style or null will be returned. If you are creating/modifying
|
||||
* styles true will be returned.
|
||||
*/
|
||||
function styles($style = null, $definition = null) {
|
||||
public function styles($style = null, $definition = null) {
|
||||
if ($style === null && $definition === null) {
|
||||
return self::$_styles;
|
||||
}
|
||||
|
|
|
@ -539,7 +539,7 @@ class Shell extends Object {
|
|||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function nl($multiplier = 1) {
|
||||
public function nl($multiplier = 1) {
|
||||
return str_repeat(ConsoleOutput::LF, $multiplier);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,11 +31,11 @@ class DbAclSchema extends CakeSchema {
|
|||
|
||||
public $name = 'DbAcl';
|
||||
|
||||
function before($event = array()) {
|
||||
public function before($event = array()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function after($event = array()) {
|
||||
public function after($event = array()) {
|
||||
}
|
||||
|
||||
public $acos = array(
|
||||
|
|
|
@ -31,11 +31,11 @@ class i18nSchema extends CakeSchema {
|
|||
|
||||
public $name = 'i18n';
|
||||
|
||||
function before($event = array()) {
|
||||
public function before($event = array()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function after($event = array()) {
|
||||
public function after($event = array()) {
|
||||
}
|
||||
|
||||
public $i18n = array(
|
||||
|
|
|
@ -31,11 +31,11 @@ class SessionsSchema extends CakeSchema {
|
|||
|
||||
public $name = 'Sessions';
|
||||
|
||||
function before($event = array()) {
|
||||
public function before($event = array()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function after($event = array()) {
|
||||
public function after($event = array()) {
|
||||
}
|
||||
|
||||
public $cake_sessions = array(
|
||||
|
|
|
@ -20,7 +20,7 @@ App::uses('BaseAuthorize', 'Controller/Component/Auth');
|
|||
* Your controller's isAuthorized() method should return a boolean to indicate whether or not the user is authorized.
|
||||
*
|
||||
* {{{
|
||||
* function isAuthorized($user) {
|
||||
* public function isAuthorized($user) {
|
||||
* if (!empty($this->request->params['admin'])) {
|
||||
* return $user['role'] == 'admin';
|
||||
* }
|
||||
|
|
|
@ -278,7 +278,7 @@ class RequestHandlerComponent extends Component {
|
|||
*
|
||||
* @return boolean True if user agent is a mobile web browser
|
||||
*/
|
||||
function isMobile() {
|
||||
public function isMobile() {
|
||||
return $this->request->is('mobile') || $this->accepts('wap');
|
||||
}
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ class SecurityComponent extends Component {
|
|||
* @see SecurityComponent::$blackHoleCallback
|
||||
* @link http://book.cakephp.org/view/1307/blackHole-object-controller-string-error
|
||||
*/
|
||||
function blackHole($controller, $error = '') {
|
||||
public function blackHole($controller, $error = '') {
|
||||
if ($this->blackHoleCallback == null) {
|
||||
$code = 404;
|
||||
if ($error == 'login') {
|
||||
|
|
|
@ -794,7 +794,7 @@ class BasicsTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPluginSplit() {
|
||||
public function testPluginSplit() {
|
||||
$result = pluginSplit('Something.else');
|
||||
$this->assertEqual($result, array('Something', 'else'));
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class CacheTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
$this->_cacheDisable = Configure::read('Cache.disable');
|
||||
Configure::write('Cache.disable', false);
|
||||
|
||||
|
@ -46,7 +46,7 @@ class CacheTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
Configure::write('Cache.disable', $this->_cacheDisable);
|
||||
Cache::config('default', $this->_defaultCacheConfig['settings']);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ class CacheTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testConfig() {
|
||||
public function testConfig() {
|
||||
$settings = array('engine' => 'File', 'path' => TMP . 'tests', 'prefix' => 'cake_test_');
|
||||
$results = Cache::config('new', $settings);
|
||||
$this->assertEqual($results, Cache::config('new'));
|
||||
|
@ -70,7 +70,7 @@ class CacheTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testNonFatalErrorsWithCachedisable() {
|
||||
public function testNonFatalErrorsWithCachedisable() {
|
||||
Configure::write('Cache.disable', true);
|
||||
Cache::config('test', array('engine' => 'File', 'path' => TMP, 'prefix' => 'error_test_'));
|
||||
|
||||
|
@ -87,7 +87,7 @@ class CacheTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConfigWithLibAndPluginEngines() {
|
||||
public function testConfigWithLibAndPluginEngines() {
|
||||
App::build(array(
|
||||
'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
|
@ -117,7 +117,7 @@ class CacheTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testInvaidConfig() {
|
||||
public function testInvaidConfig() {
|
||||
$this->expectError();
|
||||
Cache::config('invalid', array(
|
||||
'engine' => 'File',
|
||||
|
@ -136,7 +136,7 @@ class CacheTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAttemptingToConfigureANonCacheEngineClass() {
|
||||
public function testAttemptingToConfigureANonCacheEngineClass() {
|
||||
$this->getMock('StdClass', array(), array(), 'RubbishEngine');
|
||||
$this->expectException();
|
||||
Cache::config('Garbage', array(
|
||||
|
@ -150,7 +150,7 @@ class CacheTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testConfigChange() {
|
||||
public function testConfigChange() {
|
||||
$_cacheConfigSessions = Cache::config('sessions');
|
||||
$_cacheConfigTests = Cache::config('tests');
|
||||
|
||||
|
@ -169,7 +169,7 @@ class CacheTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConfigSettingDefaultConfigKey() {
|
||||
public function testConfigSettingDefaultConfigKey() {
|
||||
Cache::config('test_name', array('engine' => 'File', 'prefix' => 'test_name_'));
|
||||
|
||||
Cache::write('value_one', 'I am cached', 'test_name');
|
||||
|
@ -196,7 +196,7 @@ class CacheTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testWritingWithConfig() {
|
||||
public function testWritingWithConfig() {
|
||||
$_cacheConfigSessions = Cache::config('sessions');
|
||||
|
||||
Cache::write('test_somthing', 'this is the test data', 'tests');
|
||||
|
@ -222,7 +222,7 @@ class CacheTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConfigured() {
|
||||
public function testConfigured() {
|
||||
$result = Cache::configured();
|
||||
$this->assertTrue(in_array('_cake_core_', $result));
|
||||
$this->assertTrue(in_array('default', $result));
|
||||
|
@ -234,7 +234,7 @@ class CacheTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testInitSettings() {
|
||||
public function testInitSettings() {
|
||||
$initial = Cache::settings();
|
||||
$override = array('engine' => 'File', 'path' => TMP . 'tests');
|
||||
Cache::config('for_test', $override);
|
||||
|
@ -250,7 +250,7 @@ class CacheTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDrop() {
|
||||
public function testDrop() {
|
||||
App::build(array(
|
||||
'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
|
@ -281,7 +281,7 @@ class CacheTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testWriteEmptyValues() {
|
||||
public function testWriteEmptyValues() {
|
||||
Cache::write('App.falseTest', false);
|
||||
$this->assertIdentical(Cache::read('App.falseTest'), false);
|
||||
|
||||
|
@ -303,7 +303,7 @@ class CacheTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testWriteTriggerError() {
|
||||
public function testWriteTriggerError() {
|
||||
App::build(array(
|
||||
'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
|
@ -329,7 +329,7 @@ class CacheTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCacheDisable() {
|
||||
public function testCacheDisable() {
|
||||
Configure::write('Cache.disable', false);
|
||||
Cache::config('test_cache_disable_1', array('engine'=> 'File', 'path' => TMP . 'tests'));
|
||||
|
||||
|
@ -369,7 +369,7 @@ class CacheTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSet() {
|
||||
public function testSet() {
|
||||
$_cacheSet = Cache::set();
|
||||
|
||||
Cache::set(array('duration' => '+1 year'));
|
||||
|
@ -396,7 +396,7 @@ class CacheTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSetOnAlternateConfigs() {
|
||||
public function testSetOnAlternateConfigs() {
|
||||
Cache::config('file_config', array('engine' => 'File', 'prefix' => 'test_file_'));
|
||||
Cache::set(array('duration' => '+1 year'), 'file_config');
|
||||
$settings = Cache::settings('file_config');
|
||||
|
|
|
@ -32,7 +32,7 @@ class ApcEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
$this->skipIf(!function_exists('apc_store'), '%s Apc is not installed or configured properly');
|
||||
$this->_cacheDisable = Configure::read('Cache.disable');
|
||||
Configure::write('Cache.disable', false);
|
||||
|
@ -45,7 +45,7 @@ class ApcEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
Configure::write('Cache.disable', $this->_cacheDisable);
|
||||
Cache::drop('apc');
|
||||
Cache::config('default');
|
||||
|
@ -57,7 +57,7 @@ class ApcEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadAndWriteCache() {
|
||||
public function testReadAndWriteCache() {
|
||||
Cache::set(array('duration' => 1), 'apc');
|
||||
|
||||
$result = Cache::read('test', 'apc');
|
||||
|
@ -81,7 +81,7 @@ class ApcEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testExpiry() {
|
||||
public function testExpiry() {
|
||||
Cache::set(array('duration' => 1), 'apc');
|
||||
|
||||
$result = Cache::read('test', 'apc');
|
||||
|
@ -116,7 +116,7 @@ class ApcEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDeleteCache() {
|
||||
public function testDeleteCache() {
|
||||
$data = 'this is a test of the emergency broadcasting system';
|
||||
$result = Cache::write('delete_test', $data, 'apc');
|
||||
$this->assertTrue($result);
|
||||
|
@ -131,7 +131,7 @@ class ApcEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDecrement() {
|
||||
public function testDecrement() {
|
||||
if ($this->skipIf(!function_exists('apc_dec'), 'No apc_dec() function, cannot test decrement() %s')) {
|
||||
return;
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ class ApcEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testIncrement() {
|
||||
public function testIncrement() {
|
||||
if ($this->skipIf(!function_exists('apc_inc'), 'No apc_inc() function, cannot test increment() %s')) {
|
||||
return;
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ class ApcEngineTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testClear() {
|
||||
public function testClear() {
|
||||
Cache::write('some_value', 'value', 'apc');
|
||||
|
||||
$result = Cache::clear(false, 'apc');
|
||||
|
|
|
@ -40,7 +40,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
Configure::write('Cache.disable', false);
|
||||
Cache::config('file_test', array('engine' => 'File', 'path' => CACHE));
|
||||
|
@ -52,7 +52,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
Cache::clear(false, 'file_test');
|
||||
Cache::drop('file_test');
|
||||
|
@ -64,7 +64,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCacheDirChange() {
|
||||
public function testCacheDirChange() {
|
||||
$result = Cache::config('sessions', array('engine'=> 'File', 'path' => TMP . 'sessions'));
|
||||
$this->assertEqual($result['settings'], Cache::settings('sessions'));
|
||||
|
||||
|
@ -79,7 +79,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadAndWriteCache() {
|
||||
public function testReadAndWriteCache() {
|
||||
Cache::config('default');
|
||||
|
||||
$result = Cache::write(null, 'here', 'file_test');
|
||||
|
@ -108,7 +108,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testExpiry() {
|
||||
public function testExpiry() {
|
||||
Cache::set(array('duration' => 1), 'file_test');
|
||||
|
||||
$result = Cache::read('test', 'file_test');
|
||||
|
@ -139,7 +139,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDeleteCache() {
|
||||
public function testDeleteCache() {
|
||||
$data = 'this is a test of the emergency broadcasting system';
|
||||
$result = Cache::write('delete_test', $data, 'file_test');
|
||||
$this->assertTrue($result);
|
||||
|
@ -158,7 +158,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSerialize() {
|
||||
public function testSerialize() {
|
||||
Cache::config('file_test', array('engine' => 'File', 'serialize' => true));
|
||||
$data = 'this is a test of the emergency broadcasting system';
|
||||
$write = Cache::write('serialize_test', $data, 'file_test');
|
||||
|
@ -182,7 +182,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testClear() {
|
||||
public function testClear() {
|
||||
Cache::config('file_test', array('engine' => 'File', 'duration' => 1));
|
||||
|
||||
$data = 'this is a test of the emergency broadcasting system';
|
||||
|
@ -219,7 +219,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testClearWithPrefixes() {
|
||||
public function testClearWithPrefixes() {
|
||||
$FileOne = new FileEngine();
|
||||
$FileOne->init(array(
|
||||
'prefix' => 'prefix_one_',
|
||||
|
@ -249,7 +249,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testKeyPath() {
|
||||
public function testKeyPath() {
|
||||
$result = Cache::write('views.countries.something', 'here', 'file_test');
|
||||
$this->assertTrue($result);
|
||||
$this->assertTrue(file_exists(CACHE . 'cake_views_countries_something'));
|
||||
|
@ -267,7 +267,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRemoveWindowsSlashesFromCache() {
|
||||
public function testRemoveWindowsSlashesFromCache() {
|
||||
Cache::config('windows_test', array('engine' => 'File', 'isWindows' => true, 'prefix' => null, 'path' => TMP));
|
||||
|
||||
$expected = array (
|
||||
|
@ -313,7 +313,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testWriteQuotedString() {
|
||||
public function testWriteQuotedString() {
|
||||
Cache::config('file_test', array('engine' => 'File', 'path' => TMP . 'tests'));
|
||||
Cache::write('App.doubleQuoteTest', '"this is a quoted string"', 'file_test');
|
||||
$this->assertIdentical(Cache::read('App.doubleQuoteTest', 'file_test'), '"this is a quoted string"');
|
||||
|
@ -331,7 +331,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testErrorWhenPathDoesNotExist() {
|
||||
public function testErrorWhenPathDoesNotExist() {
|
||||
if ($this->skipIf(is_dir(TMP . 'tests' . DS . 'file_failure'), 'Cannot run test directory exists. %s')) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -27,11 +27,11 @@ class TestMemcacheEngine extends MemcacheEngine {
|
|||
* @param string $server
|
||||
* @return array
|
||||
*/
|
||||
function parseServerString($server) {
|
||||
public function parseServerString($server) {
|
||||
return $this->_parseServerString($server);
|
||||
}
|
||||
|
||||
function setMemcache($memcache) {
|
||||
public function setMemcache($memcache) {
|
||||
$this->_Memcache = $memcache;
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
$this->skipIf(!class_exists('Memcache'), '%s Memcache is not installed or configured properly');
|
||||
$this->_cacheDisable = Configure::read('Cache.disable');
|
||||
Configure::write('Cache.disable', false);
|
||||
|
@ -66,7 +66,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
Configure::write('Cache.disable', $this->_cacheDisable);
|
||||
Cache::drop('memcache');
|
||||
Cache::config('default');
|
||||
|
@ -78,7 +78,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSettings() {
|
||||
public function testSettings() {
|
||||
$settings = Cache::settings('memcache');
|
||||
unset($settings['serialize'], $settings['path']);
|
||||
$expecting = array(
|
||||
|
@ -99,7 +99,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultipleServers() {
|
||||
public function testMultipleServers() {
|
||||
$servers = array('127.0.0.1:11211', '127.0.0.1:11222');
|
||||
$available = true;
|
||||
$Memcache = new Memcache();
|
||||
|
@ -129,7 +129,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testConnect() {
|
||||
public function testConnect() {
|
||||
$Memcache = new MemcacheEngine();
|
||||
$Memcache->init(Cache::settings('memcache'));
|
||||
$result = $Memcache->connect('127.0.0.1');
|
||||
|
@ -141,7 +141,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConnectIpv6() {
|
||||
public function testConnectIpv6() {
|
||||
$Memcache = new MemcacheEngine();
|
||||
$result = $Memcache->init(array(
|
||||
'prefix' => 'cake_',
|
||||
|
@ -159,7 +159,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testParseServerStringNonLatin() {
|
||||
public function testParseServerStringNonLatin() {
|
||||
$Memcache = new TestMemcacheEngine();
|
||||
$result = $Memcache->parseServerString('schülervz.net:13211');
|
||||
$this->assertEqual($result, array('schülervz.net', '13211'));
|
||||
|
@ -174,7 +174,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadAndWriteCache() {
|
||||
public function testReadAndWriteCache() {
|
||||
Cache::set(array('duration' => 1), null, 'memcache');
|
||||
|
||||
$result = Cache::read('test', 'memcache');
|
||||
|
@ -198,7 +198,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testExpiry() {
|
||||
public function testExpiry() {
|
||||
Cache::set(array('duration' => 1), 'memcache');
|
||||
|
||||
$result = Cache::read('test', 'memcache');
|
||||
|
@ -247,7 +247,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDeleteCache() {
|
||||
public function testDeleteCache() {
|
||||
$data = 'this is a test of the emergency broadcasting system';
|
||||
$result = Cache::write('delete_test', $data, 'memcache');
|
||||
$this->assertTrue($result);
|
||||
|
@ -262,7 +262,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDecrement() {
|
||||
public function testDecrement() {
|
||||
$result = Cache::write('test_decrement', 5, 'memcache');
|
||||
$this->assertTrue($result);
|
||||
|
||||
|
@ -285,7 +285,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testIncrement() {
|
||||
public function testIncrement() {
|
||||
$result = Cache::write('test_increment', 5, 'memcache');
|
||||
$this->assertTrue($result);
|
||||
|
||||
|
@ -307,7 +307,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConfigurationConflict() {
|
||||
public function testConfigurationConflict() {
|
||||
Cache::config('long_memcache', array(
|
||||
'engine' => 'Memcache',
|
||||
'duration'=> '+2 seconds',
|
||||
|
@ -342,7 +342,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testClear() {
|
||||
public function testClear() {
|
||||
Cache::write('some_value', 'value', 'memcache');
|
||||
|
||||
$result = Cache::clear(false, 'memcache');
|
||||
|
@ -354,7 +354,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testZeroDuration() {
|
||||
public function testZeroDuration() {
|
||||
Cache::config('memcache', array('duration' => 0));
|
||||
$result = Cache::write('test_key', 'written!', 'memcache');
|
||||
|
||||
|
@ -368,7 +368,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLongDurationEqualToZero() {
|
||||
public function testLongDurationEqualToZero() {
|
||||
$memcache =& new TestMemcacheEngine();
|
||||
$memcache->settings['compress'] = false;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class XcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
$this->skipUnless(function_exists('xcache_set'), 'Xcache is not installed or configured properly');
|
||||
$this->_cacheDisable = Configure::read('Cache.disable');
|
||||
Configure::write('Cache.disable', false);
|
||||
|
@ -45,7 +45,7 @@ class XcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
Configure::write('Cache.disable', $this->_cacheDisable);
|
||||
Cache::config('default');
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class XcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSettings() {
|
||||
public function testSettings() {
|
||||
$settings = Cache::settings();
|
||||
$expecting = array(
|
||||
'prefix' => 'cake_',
|
||||
|
@ -77,7 +77,7 @@ class XcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadAndWriteCache() {
|
||||
public function testReadAndWriteCache() {
|
||||
Cache::set(array('duration' => 1));
|
||||
|
||||
$result = Cache::read('test');
|
||||
|
@ -101,7 +101,7 @@ class XcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testExpiry() {
|
||||
public function testExpiry() {
|
||||
Cache::set(array('duration' => 1));
|
||||
$result = Cache::read('test');
|
||||
$this->assertFalse($result);
|
||||
|
@ -131,7 +131,7 @@ class XcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDeleteCache() {
|
||||
public function testDeleteCache() {
|
||||
$data = 'this is a test of the emergency broadcasting system';
|
||||
$result = Cache::write('delete_test', $data);
|
||||
$this->assertTrue($result);
|
||||
|
@ -146,7 +146,7 @@ class XcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testClearCache() {
|
||||
public function testClearCache() {
|
||||
$data = 'this is a test of the emergency broadcasting system';
|
||||
$result = Cache::write('clear_test_1', $data);
|
||||
$this->assertTrue($result);
|
||||
|
@ -164,7 +164,7 @@ class XcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDecrement() {
|
||||
public function testDecrement() {
|
||||
$result = Cache::write('test_decrement', 5);
|
||||
$this->assertTrue($result);
|
||||
|
||||
|
@ -187,7 +187,7 @@ class XcacheEngineTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testIncrement() {
|
||||
public function testIncrement() {
|
||||
$result = Cache::write('test_increment', 5);
|
||||
$this->assertTrue($result);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class IniReaderTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup() {
|
||||
public function setup() {
|
||||
parent::setup();
|
||||
$this->path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ class IniReaderTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConstruct() {
|
||||
public function testConstruct() {
|
||||
$reader = new IniReader($this->path);
|
||||
$config = $reader->read('acl.ini.php');
|
||||
|
||||
|
@ -56,7 +56,7 @@ class IniReaderTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testReadingOnlyOneSection() {
|
||||
public function testReadingOnlyOneSection() {
|
||||
$reader = new IniReader($this->path, 'admin');
|
||||
$config = $reader->read('acl.ini.php');
|
||||
|
||||
|
@ -85,7 +85,7 @@ class IniReaderTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testReadingValuesWithDots() {
|
||||
public function testReadingValuesWithDots() {
|
||||
$reader = new IniReader($this->path);
|
||||
$config = $reader->read('nested.ini');
|
||||
|
||||
|
@ -99,7 +99,7 @@ class IniReaderTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testBooleanReading() {
|
||||
public function testBooleanReading() {
|
||||
$reader = new IniReader($this->path);
|
||||
$config = $reader->read('nested.ini');
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ class PhpReaderTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ class PhpReaderTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRead() {
|
||||
public function testRead() {
|
||||
$reader = new PhpReader($this->path);
|
||||
$values = $reader->read('var_test');
|
||||
$this->assertEquals('value', $values['Read']);
|
||||
|
@ -49,7 +49,7 @@ class PhpReaderTest extends CakeTestCase {
|
|||
* @expectedException ConfigureException
|
||||
* @return void
|
||||
*/
|
||||
function testReadWithNonExistantFile() {
|
||||
public function testReadWithNonExistantFile() {
|
||||
$reader = new PhpReader($this->path);
|
||||
$reader->read('fake_values');
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class PhpReaderTest extends CakeTestCase {
|
|||
* @expectedException RuntimeException
|
||||
* @return void
|
||||
*/
|
||||
function testReadEmptyFile() {
|
||||
public function testReadEmptyFile() {
|
||||
$reader = new PhpReader($this->path);
|
||||
$reader->read('empty');
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ class PhpReaderTest extends CakeTestCase {
|
|||
* @expectedException ConfigureException
|
||||
* @return void
|
||||
*/
|
||||
function testReadWithDots() {
|
||||
public function testReadWithDots() {
|
||||
$reader = new PhpReader($this->path);
|
||||
$reader->read('../empty');
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ class PhpReaderTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testReadPluginValue() {
|
||||
public function testReadPluginValue() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
), true);
|
||||
|
|
|
@ -300,7 +300,7 @@ class AclShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testInitDb() {
|
||||
public function testInitDb() {
|
||||
$this->Task->expects($this->once())->method('dispatchShell')
|
||||
->with('schema create DbAcl');
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class CommandListTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
unset($this->Shell);
|
||||
CakePlugin::unload();
|
||||
|
@ -75,7 +75,7 @@ class CommandListTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMain() {
|
||||
public function testMain() {
|
||||
$this->Shell->main();
|
||||
$output = $this->Shell->stdout->output;
|
||||
|
||||
|
@ -116,7 +116,7 @@ class CommandListTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSortPlugin() {
|
||||
public function testSortPlugin() {
|
||||
$this->Shell->params['sort'] = true;
|
||||
$this->Shell->main();
|
||||
|
||||
|
@ -140,7 +140,7 @@ class CommandListTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMainXml() {
|
||||
public function testMainXml() {
|
||||
$this->Shell->params['xml'] = true;
|
||||
$this->Shell->main();
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMergeVars() {
|
||||
public function testMergeVars() {
|
||||
$this->Shell->tasks = array('DbConfig' => array('one', 'two'));
|
||||
$this->Shell->uses = array('Posts');
|
||||
$this->Shell->mergeVars(array('tasks'), 'TestMergeShell');
|
||||
|
@ -274,7 +274,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testVerboseOutput() {
|
||||
public function testVerboseOutput() {
|
||||
$this->Shell->stdout->expects($this->at(0))->method('write')
|
||||
->with('Verbose', 1);
|
||||
$this->Shell->stdout->expects($this->at(1))->method('write')
|
||||
|
@ -295,7 +295,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testQuietOutput() {
|
||||
public function testQuietOutput() {
|
||||
$this->Shell->stdout->expects($this->once())->method('write')
|
||||
->with('Quiet', 1);
|
||||
|
||||
|
@ -447,7 +447,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function test__getArgAndParamReferences() {
|
||||
public function test__getArgAndParamReferences() {
|
||||
$this->Shell->tasks = array('TestApple');
|
||||
$this->Shell->args = array('one');
|
||||
$this->Shell->params = array('help' => false);
|
||||
|
@ -536,7 +536,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCreateFileInteractive() {
|
||||
public function testCreateFileInteractive() {
|
||||
$this->skipIf(DIRECTORY_SEPARATOR === '\\', '%s Not supported on Windows');
|
||||
|
||||
$path = TMP . 'shell_test';
|
||||
|
@ -613,7 +613,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCreateFileWindowsInteractive() {
|
||||
public function testCreateFileWindowsInteractive() {
|
||||
$this->skipIf(DIRECTORY_SEPARATOR === '/', 'testCreateFileWindowsInteractive supported on Windows only');
|
||||
|
||||
$path = TMP . 'shell_test';
|
||||
|
@ -650,7 +650,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHasTask() {
|
||||
public function testHasTask() {
|
||||
$this->Shell->tasks = array('Extract', 'DbConfig');
|
||||
$this->Shell->loadTasks();
|
||||
|
||||
|
@ -667,7 +667,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHasMethod() {
|
||||
public function testHasMethod() {
|
||||
$this->assertTrue($this->Shell->hasMethod('do_something'));
|
||||
$this->assertFalse($this->Shell->hasMethod('hr'), 'hr is callable');
|
||||
$this->assertFalse($this->Shell->hasMethod('_secret'), '_secret is callable');
|
||||
|
@ -679,7 +679,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRunCommandMain() {
|
||||
public function testRunCommandMain() {
|
||||
$methods = get_class_methods('Shell');
|
||||
$Mock = $this->getMock('Shell', array('main', 'startup'), array(), '', false);
|
||||
|
||||
|
@ -693,7 +693,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRunCommandWithMethod() {
|
||||
public function testRunCommandWithMethod() {
|
||||
$methods = get_class_methods('Shell');
|
||||
$Mock = $this->getMock('Shell', array('hit_me', 'startup'), array(), '', false);
|
||||
|
||||
|
@ -707,7 +707,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRunCommandBaseclassMethod() {
|
||||
public function testRunCommandBaseclassMethod() {
|
||||
$Mock = $this->getMock('Shell', array('startup', 'getOptionParser', 'out'), array(), '', false);
|
||||
$Parser = $this->getMock('ConsoleOptionParser', array(), array(), '', false);
|
||||
|
||||
|
@ -725,7 +725,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRunCommandMissingMethod() {
|
||||
public function testRunCommandMissingMethod() {
|
||||
$methods = get_class_methods('Shell');
|
||||
$Mock = $this->getMock('Shell', array('startup', 'getOptionParser', 'out'), array(), '', false);
|
||||
$Parser = $this->getMock('ConsoleOptionParser', array(), array(), '', false);
|
||||
|
@ -745,7 +745,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRunCommandTriggeringHelp() {
|
||||
public function testRunCommandTriggeringHelp() {
|
||||
$Parser = $this->getMock('ConsoleOptionParser', array(), array(), '', false);
|
||||
$Parser->expects($this->once())->method('parse')
|
||||
->with(array('--help'))
|
||||
|
@ -765,7 +765,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRunCommandHittingTask() {
|
||||
public function testRunCommandHittingTask() {
|
||||
$Shell = $this->getMock('Shell', array('hasTask', 'startup'), array(), '', false);
|
||||
$task = $this->getMock('Shell', array('execute', 'runCommand'), array(), '', false);
|
||||
$task->expects($this->any())->method('runCommand')
|
||||
|
@ -783,7 +783,7 @@ class ShellTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testWrapText() {
|
||||
public function testWrapText() {
|
||||
$text = 'This is the song that never ends. This is the song that never ends. This is the song that never ends.';
|
||||
$result = $this->Shell->wrapText($text, 33);
|
||||
$expected = <<<TEXT
|
||||
|
|
|
@ -155,7 +155,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testGetNameInvalidIndex() {
|
||||
public function testGetNameInvalidIndex() {
|
||||
$this->Task->interactive = true;
|
||||
$this->Task->expects($this->any())->method('in')
|
||||
->will($this->onConsecutiveCalls(50, 'q'));
|
||||
|
@ -182,7 +182,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDoHelpersTrailingSpace() {
|
||||
public function testDoHelpersTrailingSpace() {
|
||||
$this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y'));
|
||||
$this->Task->expects($this->at(1))->method('in')->will($this->returnValue(' Javascript, Ajax, CustomOne '));
|
||||
$result = $this->Task->doHelpers();
|
||||
|
@ -195,7 +195,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDoHelpersTrailingCommas() {
|
||||
public function testDoHelpersTrailingCommas() {
|
||||
$this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y'));
|
||||
$this->Task->expects($this->at(1))->method('in')->will($this->returnValue(' Javascript, Ajax, CustomOne, , '));
|
||||
$result = $this->Task->doHelpers();
|
||||
|
@ -219,7 +219,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDoComponentsTrailingSpaces() {
|
||||
public function testDoComponentsTrailingSpaces() {
|
||||
$this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y'));
|
||||
$this->Task->expects($this->at(1))->method('in')->will($this->returnValue(' RequestHandler, Security '));
|
||||
|
||||
|
@ -233,7 +233,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDoComponentsTrailingCommas() {
|
||||
public function testDoComponentsTrailingCommas() {
|
||||
$this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y'));
|
||||
$this->Task->expects($this->at(1))->method('in')->will($this->returnValue(' RequestHandler, Security, , '));
|
||||
|
||||
|
@ -459,7 +459,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testInteractiveAdminMethodsNotInteractive() {
|
||||
public function testInteractiveAdminMethodsNotInteractive() {
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
|
|
|
@ -159,7 +159,7 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testExtractWithExclude() {
|
||||
public function testExtractWithExclude() {
|
||||
$this->Task->interactive = false;
|
||||
|
||||
$this->Task->params['paths'] = CAKE . 'Test' . DS . 'test_app' . DS . 'View';
|
||||
|
@ -185,7 +185,7 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testExtractMultiplePaths() {
|
||||
public function testExtractMultiplePaths() {
|
||||
$this->Task->interactive = false;
|
||||
|
||||
$this->Task->params['paths'] =
|
||||
|
|
|
@ -159,7 +159,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testImportOptionsAlternateConnection() {
|
||||
public function testImportOptionsAlternateConnection() {
|
||||
$this->Task->connection = 'test';
|
||||
$result = $this->Task->bake('Article', false, array('schema' => 'Article'));
|
||||
$this->assertPattern("/'connection' => 'test'/", $result);
|
||||
|
|
|
@ -155,7 +155,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testGetNameValidOption() {
|
||||
public function testGetNameValidOption() {
|
||||
$listing = $this->Task->listAll('test');
|
||||
$this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls(1, 4));
|
||||
|
||||
|
@ -171,7 +171,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testGetNameWithOutOfBoundsOption() {
|
||||
public function testGetNameWithOutOfBoundsOption() {
|
||||
$this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls(99, 1));
|
||||
$this->Task->expects($this->once())->method('err');
|
||||
|
||||
|
@ -195,7 +195,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testGetTableNameCustom() {
|
||||
public function testGetTableNameCustom() {
|
||||
$this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls('n', 'my_table'));
|
||||
$result = $this->Task->getTable('BakeArticle', 'test');
|
||||
$expected = 'my_table';
|
||||
|
@ -262,7 +262,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testInteractiveFieldValidationWithBogusResponse() {
|
||||
public function testInteractiveFieldValidationWithBogusResponse() {
|
||||
$this->_useMockedOut();
|
||||
$this->Task->initValidations();
|
||||
$this->Task->interactive = true;
|
||||
|
@ -283,7 +283,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testInteractiveFieldValidationWithRegexp() {
|
||||
public function testInteractiveFieldValidationWithRegexp() {
|
||||
$this->Task->initValidations();
|
||||
$this->Task->interactive = true;
|
||||
$this->Task->expects($this->any())->method('in')
|
||||
|
@ -876,7 +876,7 @@ STRINGEND;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSkipTablesAndAll() {
|
||||
public function testSkipTablesAndAll() {
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
|
|
|
@ -293,7 +293,7 @@ class ProjectTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConsolePath() {
|
||||
public function testConsolePath() {
|
||||
$this->_setupTestProject();
|
||||
|
||||
$path = $this->Task->path . 'bake_test_app' . DS;
|
||||
|
|
|
@ -293,7 +293,7 @@ class TestTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMethodIntrospection() {
|
||||
public function testMethodIntrospection() {
|
||||
$result = $this->Task->getTestableMethods('TestTaskArticle');
|
||||
$expected = array('dosomething', 'dosomethingelse');
|
||||
$this->assertEqual(array_map('strtolower', $result), $expected);
|
||||
|
@ -541,7 +541,7 @@ class TestTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testInteractiveWithPlugin() {
|
||||
public function testInteractiveWithPlugin() {
|
||||
$testApp = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS;
|
||||
App::build(array(
|
||||
'plugins' => array($testApp)
|
||||
|
|
|
@ -341,7 +341,7 @@ class ViewTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testBakeEdit() {
|
||||
public function testBakeEdit() {
|
||||
$this->Task->controllerName = 'ViewTaskComments';
|
||||
|
||||
$this->Task->expects($this->at(0))->method('createFile')
|
||||
|
@ -357,7 +357,7 @@ class ViewTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testBakeIndex() {
|
||||
public function testBakeIndex() {
|
||||
$this->Task->controllerName = 'ViewTaskComments';
|
||||
|
||||
$this->Task->expects($this->at(0))->method('createFile')
|
||||
|
@ -373,7 +373,7 @@ class ViewTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testBakeWithNoTemplate() {
|
||||
public function testBakeWithNoTemplate() {
|
||||
$this->Task->controllerName = 'ViewTaskComments';
|
||||
|
||||
$this->Task->expects($this->never())->method('createFile');
|
||||
|
@ -709,7 +709,7 @@ class ViewTaskTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testGetTemplate() {
|
||||
public function testGetTemplate() {
|
||||
$result = $this->Task->getTemplate('delete');
|
||||
$this->assertFalse($result);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return Mock object
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
ConsoleErrorHandler::$stderr = $this->getMock('ConsoleOutput', array(), array(), '', false);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHandleError() {
|
||||
public function testHandleError() {
|
||||
$content = "<error>Notice Error:</error> This is a notice error in [/some/file, line 275]\n";
|
||||
ConsoleErrorHandler::$stderr->expects($this->once())->method('write')
|
||||
->with($content);
|
||||
|
@ -63,7 +63,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCakeErrors() {
|
||||
public function testCakeErrors() {
|
||||
$exception = new MissingActionException('Missing action');
|
||||
ConsoleErrorHandler::$stderr->expects($this->once())->method('write')
|
||||
->with($this->stringContains('Missing action'));
|
||||
|
@ -76,7 +76,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testNonCakeExceptions() {
|
||||
public function testNonCakeExceptions() {
|
||||
$exception = new InvalidArgumentException('Too many parameters.');
|
||||
|
||||
ConsoleErrorHandler::$stderr->expects($this->once())->method('write')
|
||||
|
@ -90,7 +90,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testError404Exception() {
|
||||
public function testError404Exception() {
|
||||
$exception = new NotFoundException('dont use me in cli.');
|
||||
|
||||
ConsoleErrorHandler::$stderr->expects($this->once())->method('write')
|
||||
|
@ -104,7 +104,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testError500Exception() {
|
||||
public function testError500Exception() {
|
||||
$exception = new InternalErrorException('dont use me in cli.');
|
||||
|
||||
ConsoleErrorHandler::$stderr->expects($this->once())->method('write')
|
||||
|
|
|
@ -26,7 +26,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDescription() {
|
||||
public function testDescription() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$result = $parser->description('A test');
|
||||
|
||||
|
@ -42,7 +42,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testEpilog() {
|
||||
public function testEpilog() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$result = $parser->epilog('A test');
|
||||
|
||||
|
@ -58,7 +58,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddOptionReturnSelf() {
|
||||
public function testAddOptionReturnSelf() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$result = $parser->addOption('test');
|
||||
$this->assertEquals($parser, $result, 'Did not return $this from addOption');
|
||||
|
@ -69,7 +69,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddOptionLong() {
|
||||
public function testAddOptionLong() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('test', array(
|
||||
'short' => 't'
|
||||
|
@ -83,7 +83,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddOptionObject() {
|
||||
public function testAddOptionObject() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption(new ConsoleInputOption('test', 't'));
|
||||
$result = $parser->parse(array('--test=value'));
|
||||
|
@ -95,7 +95,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddOptionLongEquals() {
|
||||
public function testAddOptionLongEquals() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('test', array(
|
||||
'short' => 't'
|
||||
|
@ -109,7 +109,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddOptionDefault() {
|
||||
public function testAddOptionDefault() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('test', array(
|
||||
'default' => 'default value',
|
||||
|
@ -130,7 +130,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddOptionShort() {
|
||||
public function testAddOptionShort() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('test', array(
|
||||
'short' => 't'
|
||||
|
@ -144,7 +144,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddOptionBoolean() {
|
||||
public function testAddOptionBoolean() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('test', array(
|
||||
'boolean' => true,
|
||||
|
@ -164,7 +164,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddOptionMultipleShort() {
|
||||
public function testAddOptionMultipleShort() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('test', array('short' => 't', 'boolean' => true))
|
||||
->addOption('file', array('short' => 'f', 'boolean' => true))
|
||||
|
@ -183,7 +183,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMultipleOptions() {
|
||||
public function testMultipleOptions() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('test')
|
||||
->addOption('connection')
|
||||
|
@ -199,7 +199,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddOptions() {
|
||||
public function testAddOptions() {
|
||||
$parser = new ConsoleOptionParser('something', false);
|
||||
$result = $parser->addOptions(array(
|
||||
'name' => array('help' => 'The name'),
|
||||
|
@ -216,7 +216,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testOptionWithBooleanParam() {
|
||||
public function testOptionWithBooleanParam() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('no-commit', array('boolean' => true))
|
||||
->addOption('table', array('short' => 't'));
|
||||
|
@ -231,7 +231,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @expectedException ConsoleException
|
||||
*/
|
||||
function testOptionThatDoesNotExist() {
|
||||
public function testOptionThatDoesNotExist() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('no-commit', array('boolean' => true));
|
||||
|
||||
|
@ -244,7 +244,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
* @expectedException ConsoleException
|
||||
* @return void
|
||||
*/
|
||||
function testOptionWithChoices() {
|
||||
public function testOptionWithChoices() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('name', array('choices' => array('mark', 'jose')));
|
||||
|
||||
|
@ -260,7 +260,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPositionalArgument() {
|
||||
public function testPositionalArgument() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$result = $parser->addArgument('name', array('help' => 'An argument'));
|
||||
$this->assertEquals($parser, $result, 'Should returnn this');
|
||||
|
@ -271,7 +271,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddArgumentObject() {
|
||||
public function testAddArgumentObject() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addArgument(new ConsoleInputArgument('test'));
|
||||
$result = $parser->arguments();
|
||||
|
@ -284,7 +284,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPositionalArgOverwrite() {
|
||||
public function testPositionalArgOverwrite() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addArgument('name', array('help' => 'An argument'))
|
||||
->addArgument('other', array('index' => 0));
|
||||
|
@ -299,7 +299,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
* @expectedException ConsoleException
|
||||
* @return void
|
||||
*/
|
||||
function testParseArgumentTooMany() {
|
||||
public function testParseArgumentTooMany() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addArgument('name', array('help' => 'An argument'))
|
||||
->addArgument('other');
|
||||
|
@ -317,7 +317,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
* @expectedException ConsoleException
|
||||
* @return void
|
||||
*/
|
||||
function testPositionalArgNotEnough() {
|
||||
public function testPositionalArgNotEnough() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addArgument('name', array('required' => true))
|
||||
->addArgument('other', array('required' => true));
|
||||
|
@ -331,7 +331,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
* @expectedException ConsoleException
|
||||
* @return void
|
||||
*/
|
||||
function testPositionalArgWithChoices() {
|
||||
public function testPositionalArgWithChoices() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addArgument('name', array('choices' => array('mark', 'jose')))
|
||||
->addArgument('alias', array('choices' => array('cowboy', 'samurai')))
|
||||
|
@ -349,7 +349,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddArguments() {
|
||||
public function testAddArguments() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$result = $parser->addArguments(array(
|
||||
'name' => array('help' => 'The name'),
|
||||
|
@ -366,7 +366,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSubcommand() {
|
||||
public function testSubcommand() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$result = $parser->addSubcommand('initdb', array(
|
||||
'help' => 'Initialize the database'
|
||||
|
@ -379,7 +379,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddSubcommandObject() {
|
||||
public function testAddSubcommandObject() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addSubcommand(new ConsoleInputSubcommand('test'));
|
||||
$result = $parser->subcommands();
|
||||
|
@ -392,7 +392,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAddSubcommands() {
|
||||
public function testAddSubcommands() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$result = $parser->addSubcommands(array(
|
||||
'initdb' => array('help' => 'Initialize the database'),
|
||||
|
@ -408,7 +408,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHelpNoExceptionWhenGettingHelp() {
|
||||
public function testHelpNoExceptionWhenGettingHelp() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->addOption('test', array('help' => 'A test option.'))
|
||||
->addArgument('model', array('help' => 'The model to make.', 'required' => true));
|
||||
|
@ -422,7 +422,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHelpSubcommandHelp() {
|
||||
public function testHelpSubcommandHelp() {
|
||||
$subParser = new ConsoleOptionParser('method', false);
|
||||
$subParser->addOption('connection', array('help' => 'Db connection.'));
|
||||
|
||||
|
@ -452,7 +452,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testBuildFromArray() {
|
||||
public function testBuildFromArray() {
|
||||
$spec = array(
|
||||
'command' => 'test',
|
||||
'arguments' => array(
|
||||
|
@ -490,7 +490,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCreateFactory() {
|
||||
public function testCreateFactory() {
|
||||
$parser = ConsoleOptionParser::create('factory', false);
|
||||
$this->assertInstanceOf('ConsoleOptionParser', $parser);
|
||||
$this->assertEquals('factory', $parser->command());
|
||||
|
@ -502,7 +502,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testParsingWithSubParser() {
|
||||
public function testParsingWithSubParser() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('primary')
|
||||
->addArgument('one', array('required' => true, 'choices' => array('a', 'b')))
|
||||
|
|
|
@ -26,7 +26,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->output = $this->getMock('ConsoleOutput', array('_write'));
|
||||
$this->output->outputAs(ConsoleOutput::COLOR);
|
||||
|
@ -37,7 +37,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
unset($this->output);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testWriteNoNewLine() {
|
||||
public function testWriteNoNewLine() {
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with('Some output');
|
||||
|
||||
|
@ -58,7 +58,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testWriteNewLine() {
|
||||
public function testWriteNewLine() {
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with('Some output' . PHP_EOL);
|
||||
|
||||
|
@ -70,7 +70,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testWriteMultipleNewLines() {
|
||||
public function testWriteMultipleNewLines() {
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with('Some output' . PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL);
|
||||
|
||||
|
@ -82,7 +82,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testWriteArray() {
|
||||
public function testWriteArray() {
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with('Line' . PHP_EOL . 'Line' . PHP_EOL . 'Line' . PHP_EOL);
|
||||
|
||||
|
@ -94,7 +94,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testStylesGet() {
|
||||
public function testStylesGet() {
|
||||
$result = $this->output->styles('error');
|
||||
$expected = array('text' => 'red', 'underline' => true);
|
||||
$this->assertEqual($expected, $result);
|
||||
|
@ -111,7 +111,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testStylesAdding() {
|
||||
public function testStylesAdding() {
|
||||
$this->output->styles('test', array('text' => 'red', 'background' => 'black'));
|
||||
$result = $this->output->styles('test');
|
||||
$expected = array('text' => 'red', 'background' => 'black');
|
||||
|
@ -126,7 +126,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testFormattingSimple() {
|
||||
public function testFormattingSimple() {
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with("\033[31;4mError:\033[0m Something bad");
|
||||
|
||||
|
@ -138,7 +138,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testFormattingNotEatingTags() {
|
||||
public function testFormattingNotEatingTags() {
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with("<red> Something bad");
|
||||
|
||||
|
@ -150,7 +150,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testFormattingCustom() {
|
||||
public function testFormattingCustom() {
|
||||
$this->output->styles('annoying', array(
|
||||
'text' => 'magenta',
|
||||
'background' => 'cyan',
|
||||
|
@ -169,7 +169,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testFormattingMissingStyleName() {
|
||||
public function testFormattingMissingStyleName() {
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with("<not_there>Error:</not_there> Something bad");
|
||||
|
||||
|
@ -181,7 +181,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testFormattingMultipleStylesName() {
|
||||
public function testFormattingMultipleStylesName() {
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with("\033[31;4mBad\033[0m \033[33mWarning\033[0m Regular");
|
||||
|
||||
|
@ -193,7 +193,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testFormattingMultipleSameTags() {
|
||||
public function testFormattingMultipleSameTags() {
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with("\033[31;4mBad\033[0m \033[31;4mWarning\033[0m Regular");
|
||||
|
||||
|
@ -205,7 +205,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testOutputAsRaw() {
|
||||
public function testOutputAsRaw() {
|
||||
$this->output->outputAs(ConsoleOutput::RAW);
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with('<error>Bad</error> Regular');
|
||||
|
@ -218,7 +218,7 @@ class ConsoleOutputTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testOutputAsPlain() {
|
||||
public function testOutputAsPlain() {
|
||||
$this->output->outputAs(ConsoleOutput::PLAIN);
|
||||
$this->output->expects($this->once())->method('_write')
|
||||
->with('Bad Regular');
|
||||
|
|
|
@ -10,7 +10,7 @@ class HelpFormatterTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testWidthFormatting() {
|
||||
public function testWidthFormatting() {
|
||||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->description('This is fifteen This is fifteen This is fifteen')
|
||||
->addOption('four', array('help' => 'this is help text this is help text'))
|
||||
|
@ -54,7 +54,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHelpWithChoices() {
|
||||
public function testHelpWithChoices() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->addOption('test', array('help' => 'A test option.', 'choices' => array('one', 'two')))
|
||||
->addArgument('type', array(
|
||||
|
@ -89,7 +89,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHelpDescriptionAndEpilog() {
|
||||
public function testHelpDescriptionAndEpilog() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->description('Description text')
|
||||
->epilog('epilog text')
|
||||
|
@ -124,7 +124,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHelpSubcommand() {
|
||||
public function testHelpSubcommand() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->addSubcommand('method', array('help' => 'This is another command'))
|
||||
->addOption('test', array('help' => 'A test option.'));
|
||||
|
@ -155,7 +155,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHelpWithOptions() {
|
||||
public function testHelpWithOptions() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->addOption('test', array('help' => 'A test option.'))
|
||||
->addOption('connection', array(
|
||||
|
@ -184,7 +184,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHelpWithOptionsAndArguments() {
|
||||
public function testHelpWithOptionsAndArguments() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->addOption('test', array('help' => 'A test option.'))
|
||||
->addArgument('model', array('help' => 'The model to make.', 'required' => true))
|
||||
|
@ -215,7 +215,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testXmlHelpWithChoices() {
|
||||
public function testXmlHelpWithChoices() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->addOption('test', array('help' => 'A test option.', 'choices' => array('one', 'two')))
|
||||
->addArgument('type', array(
|
||||
|
@ -265,7 +265,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testXmlHelpDescriptionAndEpilog() {
|
||||
public function testXmlHelpDescriptionAndEpilog() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->description('Description text')
|
||||
->epilog('epilog text')
|
||||
|
@ -306,7 +306,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testXmlHelpSubcommand() {
|
||||
public function testXmlHelpSubcommand() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->addSubcommand('method', array('help' => 'This is another command'))
|
||||
->addOption('test', array('help' => 'A test option.'));
|
||||
|
@ -343,7 +343,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testXmlHelpWithOptions() {
|
||||
public function testXmlHelpWithOptions() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->addOption('test', array('help' => 'A test option.'))
|
||||
->addOption('connection', array(
|
||||
|
@ -384,7 +384,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testXmlHelpWithOptionsAndArguments() {
|
||||
public function testXmlHelpWithOptionsAndArguments() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->addOption('test', array('help' => 'A test option.'))
|
||||
->addArgument('model', array('help' => 'The model to make.', 'required' => true))
|
||||
|
@ -427,7 +427,7 @@ TEXT;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testXmlHelpAsObject() {
|
||||
public function testXmlHelpAsObject() {
|
||||
$parser = new ConsoleOptionParser('mycommand', false);
|
||||
$parser->addOption('test', array('help' => 'A test option.'))
|
||||
->addArgument('model', array('help' => 'The model to make.', 'required' => true))
|
||||
|
|
|
@ -26,7 +26,7 @@ class TaskCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup() {
|
||||
public function setup() {
|
||||
$shell = $this->getMock('Shell', array(), array(), '', false);
|
||||
$dispatcher = $this->getMock('ShellDispatcher', array(), array(), '', false);
|
||||
$this->Tasks = new TaskCollection($shell, $dispatcher);
|
||||
|
@ -37,7 +37,7 @@ class TaskCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function teardown() {
|
||||
public function teardown() {
|
||||
unset($this->Tasks);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ class TaskCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoad() {
|
||||
public function testLoad() {
|
||||
$result = $this->Tasks->load('DbConfig');
|
||||
$this->assertInstanceOf('DbConfigTask', $result);
|
||||
$this->assertInstanceOf('DbConfigTask', $this->Tasks->DbConfig);
|
||||
|
@ -62,7 +62,7 @@ class TaskCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoadWithEnableFalse() {
|
||||
public function testLoadWithEnableFalse() {
|
||||
$result = $this->Tasks->load('DbConfig', array('enabled' => false));
|
||||
$this->assertInstanceOf('DbConfigTask', $result);
|
||||
$this->assertInstanceOf('DbConfigTask', $this->Tasks->DbConfig);
|
||||
|
@ -75,7 +75,7 @@ class TaskCollectionTest extends CakeTestCase {
|
|||
* @expectedException MissingTaskClassException
|
||||
* @return void
|
||||
*/
|
||||
function testLoadMissingTaskFile() {
|
||||
public function testLoadMissingTaskFile() {
|
||||
$result = $this->Tasks->load('ThisTaskShouldAlwaysBeMissing');
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ class TaskCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoadPluginTask() {
|
||||
public function testLoadPluginTask() {
|
||||
$dispatcher = $this->getMock('ShellDispatcher', array(), array(), '', false);
|
||||
$shell = $this->getMock('Shell', array(), array(), '', false);
|
||||
App::build(array(
|
||||
|
@ -104,7 +104,7 @@ class TaskCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testUnload() {
|
||||
public function testUnload() {
|
||||
$this->Tasks->load('Extract');
|
||||
$this->Tasks->load('DbConfig');
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ class AclComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
if (!class_exists('MockAclImplementation', false)) {
|
||||
$this->getMock('AclInterface', array(), array(), 'MockAclImplementation');
|
||||
|
@ -204,7 +204,7 @@ class AclComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
unset($this->Acl);
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ class AclComponentTest extends CakeTestCase {
|
|||
* @expectedException CakeException
|
||||
* @return void
|
||||
*/
|
||||
function testConstrutorException() {
|
||||
public function testConstrutorException() {
|
||||
Configure::write('Acl.classname', 'AclClassNameThatDoesNotExist');
|
||||
$Collection = new ComponentCollection();
|
||||
$acl = new AclComponent($Collection);
|
||||
|
@ -227,7 +227,7 @@ class AclComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAdapter() {
|
||||
public function testAdapter() {
|
||||
$implementation = new MockAclImplementation();
|
||||
$implementation->expects($this->once())->method('initialize')->with($this->Acl);
|
||||
$this->assertNull($this->Acl->adapter($implementation));
|
||||
|
@ -241,7 +241,7 @@ class AclComponentTest extends CakeTestCase {
|
|||
* @expectedException CakeException
|
||||
* @return void
|
||||
*/
|
||||
function testAdapterException() {
|
||||
public function testAdapterException() {
|
||||
$thing = new StdClass();
|
||||
$this->Acl->adapter($thing);
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ class IniAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCheck() {
|
||||
public function testCheck() {
|
||||
$iniFile = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';
|
||||
|
||||
$Ini = new IniAcl();
|
||||
|
@ -284,7 +284,7 @@ class IniAclTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCheckArray() {
|
||||
public function testCheckArray() {
|
||||
$iniFile = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';
|
||||
|
||||
$Ini = new IniAcl();
|
||||
|
@ -318,7 +318,7 @@ class DbAclTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
Configure::write('Acl.classname', 'DbAclTwoTest');
|
||||
Configure::write('Acl.database', 'test');
|
||||
|
@ -332,7 +332,7 @@ class DbAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
unset($this->Acl);
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ class DbAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCreate() {
|
||||
public function testCreate() {
|
||||
$this->Acl->Aro->create(array('alias' => 'Chotchkey'));
|
||||
$this->assertTrue((bool)$this->Acl->Aro->save());
|
||||
|
||||
|
@ -371,7 +371,7 @@ class DbAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCreateWithParent() {
|
||||
public function testCreateWithParent() {
|
||||
$parent = $this->Acl->Aro->findByAlias('Peter', null, null, -1);
|
||||
$this->Acl->Aro->create();
|
||||
$this->Acl->Aro->save(array(
|
||||
|
@ -391,7 +391,7 @@ class DbAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAllow() {
|
||||
public function testAllow() {
|
||||
$this->assertFalse($this->Acl->check('Micheal', 'tpsReports', 'read'));
|
||||
$this->assertTrue($this->Acl->allow('Micheal', 'tpsReports', array('read', 'delete', 'update')));
|
||||
$this->assertTrue($this->Acl->check('Micheal', 'tpsReports', 'update'));
|
||||
|
@ -440,7 +440,7 @@ class DbAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCheck() {
|
||||
public function testCheck() {
|
||||
$this->assertTrue($this->Acl->check('Samir', 'print', 'read'));
|
||||
$this->assertTrue($this->Acl->check('Lumbergh', 'current', 'read'));
|
||||
$this->assertFalse($this->Acl->check('Milton', 'smash', 'read'));
|
||||
|
@ -497,7 +497,7 @@ class DbAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAclCascadingDeny() {
|
||||
public function testAclCascadingDeny() {
|
||||
$this->Acl->inherit('Bobs', 'ROOT', '*');
|
||||
$this->assertTrue($this->Acl->check('admin', 'tpsReports', 'delete'));
|
||||
$this->assertTrue($this->Acl->check('Bobs', 'tpsReports', 'delete'));
|
||||
|
@ -512,7 +512,7 @@ class DbAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDeny() {
|
||||
public function testDeny() {
|
||||
$this->assertTrue($this->Acl->check('Micheal', 'smash', 'delete'));
|
||||
$this->Acl->deny('Micheal', 'smash', 'delete');
|
||||
$this->assertFalse($this->Acl->check('Micheal', 'smash', 'delete'));
|
||||
|
@ -542,7 +542,7 @@ class DbAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAclNodeLookup() {
|
||||
public function testAclNodeLookup() {
|
||||
$result = $this->Acl->Aro->node('root/users/Samir');
|
||||
$expected = array(
|
||||
array('AroTwoTest' => array('id' => '7', 'parent_id' => '4', 'model' => 'User', 'foreign_key' => 3, 'alias' => 'Samir')),
|
||||
|
@ -567,7 +567,7 @@ class DbAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testInherit() {
|
||||
public function testInherit() {
|
||||
//parent doesn't have access inherit should still deny
|
||||
$this->assertFalse($this->Acl->check('Milton', 'smash', 'delete'));
|
||||
$this->Acl->inherit('Milton', 'smash', 'delete');
|
||||
|
@ -585,7 +585,7 @@ class DbAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGrant() {
|
||||
public function testGrant() {
|
||||
$this->assertFalse($this->Acl->check('Samir', 'tpsReports', 'create'));
|
||||
$this->Acl->allow('Samir', 'tpsReports', 'create');
|
||||
$this->assertTrue($this->Acl->check('Samir', 'tpsReports', 'create'));
|
||||
|
@ -607,7 +607,7 @@ class DbAclTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRevoke() {
|
||||
public function testRevoke() {
|
||||
$this->assertTrue($this->Acl->check('Bobs', 'tpsReports', 'read'));
|
||||
$this->Acl->deny('Bobs', 'tpsReports', 'read');
|
||||
$this->assertFalse($this->Acl->check('Bobs', 'tpsReports', 'read'));
|
||||
|
|
|
@ -27,7 +27,7 @@ class ActionsAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->controller = $this->getMock('Controller', array(), array(), '', false);
|
||||
$this->Acl = $this->getMock('AclComponent', array(), array(), '', false);
|
||||
|
@ -54,7 +54,7 @@ class ActionsAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthorizeFailure() {
|
||||
public function testAuthorizeFailure() {
|
||||
$user = array(
|
||||
'User' => array(
|
||||
'id' => 1,
|
||||
|
@ -83,7 +83,7 @@ class ActionsAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthorizeSuccess() {
|
||||
public function testAuthorizeSuccess() {
|
||||
$user = array(
|
||||
'User' => array(
|
||||
'id' => 1,
|
||||
|
@ -112,7 +112,7 @@ class ActionsAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testActionMethod() {
|
||||
public function testActionMethod() {
|
||||
$request = new CakeRequest('/posts/index', false);
|
||||
$request->addParams(array(
|
||||
'plugin' => null,
|
||||
|
@ -130,7 +130,7 @@ class ActionsAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testActionWithPlugin() {
|
||||
public function testActionWithPlugin() {
|
||||
$request = new CakeRequest('/debug_kit/posts/index', false);
|
||||
$request->addParams(array(
|
||||
'plugin' => 'debug_kit',
|
||||
|
|
|
@ -37,7 +37,7 @@ class BasicAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->Collection = $this->getMock('ComponentCollection');
|
||||
$this->auth = new BasicAuthenticate($this->Collection, array(
|
||||
|
@ -57,7 +57,7 @@ class BasicAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
$_SERVER = $this->server;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ class BasicAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConstructor() {
|
||||
public function testConstructor() {
|
||||
$object = new BasicAuthenticate($this->Collection, array(
|
||||
'userModel' => 'AuthUser',
|
||||
'fields' => array('username' => 'user', 'password' => 'password')
|
||||
|
@ -82,7 +82,7 @@ class BasicAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateNoData() {
|
||||
public function testAuthenticateNoData() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
|
||||
$this->response->expects($this->once())
|
||||
|
@ -97,7 +97,7 @@ class BasicAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateNoUsername() {
|
||||
public function testAuthenticateNoUsername() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$_SERVER['PHP_AUTH_PW'] = 'foobar';
|
||||
|
||||
|
@ -113,7 +113,7 @@ class BasicAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateNoPassword() {
|
||||
public function testAuthenticateNoPassword() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$_SERVER['PHP_AUTH_USER'] = 'mariano';
|
||||
$_SERVER['PHP_AUTH_PW'] = null;
|
||||
|
@ -130,7 +130,7 @@ class BasicAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateInjection() {
|
||||
public function testAuthenticateInjection() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->addParams(array('pass' => array(), 'named' => array()));
|
||||
|
||||
|
@ -145,7 +145,7 @@ class BasicAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateChallenge() {
|
||||
public function testAuthenticateChallenge() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->addParams(array('pass' => array(), 'named' => array()));
|
||||
|
||||
|
@ -164,7 +164,7 @@ class BasicAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateSuccess() {
|
||||
public function testAuthenticateSuccess() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->addParams(array('pass' => array(), 'named' => array()));
|
||||
|
||||
|
@ -186,7 +186,7 @@ class BasicAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateFailReChallenge() {
|
||||
public function testAuthenticateFailReChallenge() {
|
||||
$this->auth->settings['scope'] = array('user' => 'nate');
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->addParams(array('pass' => array(), 'named' => array()));
|
||||
|
|
|
@ -26,7 +26,7 @@ class ControllerAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->controller = $this->getMock('Controller', array('isAuthorized'), array(), '', false);
|
||||
$this->components = $this->getMock('ComponentCollection');
|
||||
|
@ -41,14 +41,14 @@ class ControllerAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @expectedException CakeException
|
||||
*/
|
||||
function testControllerTypeError() {
|
||||
public function testControllerTypeError() {
|
||||
$this->auth->controller(new StdClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException CakeException
|
||||
*/
|
||||
function testControllerErrorOnMissingMethod() {
|
||||
public function testControllerErrorOnMissingMethod() {
|
||||
$this->auth->controller(new Controller());
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ class ControllerAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthorizeFailure() {
|
||||
public function testAuthorizeFailure() {
|
||||
$user = array();
|
||||
$request = new CakeRequest('/posts/index', false);
|
||||
$this->assertFalse($this->auth->authorize($user, $request));
|
||||
|
@ -68,7 +68,7 @@ class ControllerAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthorizeSuccess() {
|
||||
public function testAuthorizeSuccess() {
|
||||
$user = array('User' => array('username' => 'mark'));
|
||||
$request = new CakeRequest('/posts/index', false);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class CrudAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
Configure::write('Routing.prefixes', array());
|
||||
|
||||
parent::setUp();
|
||||
|
@ -56,7 +56,7 @@ class CrudAuthorizeTest extends CakeTestCase {
|
|||
* @expectedException Exception
|
||||
* @return void
|
||||
*/
|
||||
function testAuthorizeNoMappedAction() {
|
||||
public function testAuthorizeNoMappedAction() {
|
||||
$request = new CakeRequest('/posts/foobar', false);
|
||||
$request->addParams(array(
|
||||
'controller' => 'posts',
|
||||
|
@ -72,7 +72,7 @@ class CrudAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthorizeCheckSuccess() {
|
||||
public function testAuthorizeCheckSuccess() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->addParams(array(
|
||||
'controller' => 'posts',
|
||||
|
@ -94,7 +94,7 @@ class CrudAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthorizeCheckFailure() {
|
||||
public function testAuthorizeCheckFailure() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->addParams(array(
|
||||
'controller' => 'posts',
|
||||
|
@ -117,7 +117,7 @@ class CrudAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMapActionsGet() {
|
||||
public function testMapActionsGet() {
|
||||
$result = $this->auth->mapActions();
|
||||
$expected = array(
|
||||
'create' => 'create',
|
||||
|
@ -138,7 +138,7 @@ class CrudAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMapActionsSet() {
|
||||
public function testMapActionsSet() {
|
||||
$map = array(
|
||||
'create' => array('generate'),
|
||||
'read' => array('listing', 'show'),
|
||||
|
@ -173,7 +173,7 @@ class CrudAuthorizeTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAutoPrefixMapActions() {
|
||||
public function testAutoPrefixMapActions() {
|
||||
Configure::write('Routing.prefixes', array('admin', 'manager'));
|
||||
Router::reload();
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class DigestAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->Collection = $this->getMock('ComponentCollection');
|
||||
$this->server = $_SERVER;
|
||||
|
@ -59,7 +59,7 @@ class DigestAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
$_SERVER = $this->server;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ class DigestAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConstructor() {
|
||||
public function testConstructor() {
|
||||
$object = new DigestAuthenticate($this->Collection, array(
|
||||
'userModel' => 'AuthUser',
|
||||
'fields' => array('username' => 'user', 'password' => 'password'),
|
||||
|
@ -86,7 +86,7 @@ class DigestAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateNoData() {
|
||||
public function testAuthenticateNoData() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
|
||||
$this->response->expects($this->once())
|
||||
|
@ -101,7 +101,7 @@ class DigestAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateWrongUsername() {
|
||||
public function testAuthenticateWrongUsername() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->addParams(array('pass' => array(), 'named' => array()));
|
||||
|
||||
|
@ -136,7 +136,7 @@ DIGEST;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateChallenge() {
|
||||
public function testAuthenticateChallenge() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->addParams(array('pass' => array(), 'named' => array()));
|
||||
|
||||
|
@ -160,7 +160,7 @@ DIGEST;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateSuccess() {
|
||||
public function testAuthenticateSuccess() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->addParams(array('pass' => array(), 'named' => array()));
|
||||
|
||||
|
@ -191,7 +191,7 @@ DIGEST;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateFailReChallenge() {
|
||||
public function testAuthenticateFailReChallenge() {
|
||||
$this->auth->settings['scope'] = array('user' => 'nate');
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->addParams(array('pass' => array(), 'named' => array()));
|
||||
|
@ -228,7 +228,7 @@ DIGEST;
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testParseAuthData() {
|
||||
public function testParseAuthData() {
|
||||
$digest = <<<DIGEST
|
||||
Digest username="Mufasa",
|
||||
realm="testrealm@host.com",
|
||||
|
@ -263,7 +263,7 @@ DIGEST;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testParseAuthEmailAddress() {
|
||||
public function testParseAuthEmailAddress() {
|
||||
$digest = <<<DIGEST
|
||||
Digest username="mark@example.com",
|
||||
realm="testrealm@host.com",
|
||||
|
@ -295,7 +295,7 @@ DIGEST;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPassword() {
|
||||
public function testPassword() {
|
||||
$result = DigestAuthenticate::password('mark', 'password', 'localhost');
|
||||
$expected = md5('mark:localhost:password');
|
||||
$this->assertEquals($expected, $result);
|
||||
|
|
|
@ -36,7 +36,7 @@ class FormAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->Collection = $this->getMock('ComponentCollection');
|
||||
$this->auth = new FormAuthenticate($this->Collection, array(
|
||||
|
@ -53,7 +53,7 @@ class FormAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConstructor() {
|
||||
public function testConstructor() {
|
||||
$object = new FormAuthenticate($this->Collection, array(
|
||||
'userModel' => 'AuthUser',
|
||||
'fields' => array('username' => 'user', 'password' => 'password')
|
||||
|
@ -67,7 +67,7 @@ class FormAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateNoData() {
|
||||
public function testAuthenticateNoData() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->data = array();
|
||||
$this->assertFalse($this->auth->authenticate($request, $this->response));
|
||||
|
@ -78,7 +78,7 @@ class FormAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateNoUsername() {
|
||||
public function testAuthenticateNoUsername() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->data = array('User' => array('password' => 'foobar'));
|
||||
$this->assertFalse($this->auth->authenticate($request, $this->response));
|
||||
|
@ -89,7 +89,7 @@ class FormAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateNoPassword() {
|
||||
public function testAuthenticateNoPassword() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->data = array('User' => array('user' => 'mariano'));
|
||||
$this->assertFalse($this->auth->authenticate($request, $this->response));
|
||||
|
@ -100,7 +100,7 @@ class FormAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateInjection() {
|
||||
public function testAuthenticateInjection() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->data = array(
|
||||
'User' => array(
|
||||
|
@ -115,7 +115,7 @@ class FormAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateSuccess() {
|
||||
public function testAuthenticateSuccess() {
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->data = array('User' => array(
|
||||
'user' => 'mariano',
|
||||
|
@ -136,7 +136,7 @@ class FormAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAuthenticateScopeFail() {
|
||||
public function testAuthenticateScopeFail() {
|
||||
$this->auth->settings['scope'] = array('user' => 'nate');
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
$request->data = array('User' => array(
|
||||
|
@ -152,7 +152,7 @@ class FormAuthenticateTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPluginModel() {
|
||||
public function testPluginModel() {
|
||||
Cache::delete('object_map', '_cake_core_');
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||
|
|
|
@ -136,7 +136,7 @@ class AuthTestController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function login() {
|
||||
public function login() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,7 +145,7 @@ class AuthTestController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function admin_login() {
|
||||
public function admin_login() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,7 +154,7 @@ class AuthTestController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function admin_add() {
|
||||
public function admin_add() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -163,7 +163,7 @@ class AuthTestController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function logout() {
|
||||
public function logout() {
|
||||
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ class AuthTestController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function add() {
|
||||
public function add() {
|
||||
echo "add";
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ class AuthTestController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function camelCase() {
|
||||
public function camelCase() {
|
||||
echo "camelCase";
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ class AuthTestController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function redirect($url, $status = null, $exit = true) {
|
||||
public function redirect($url, $status = null, $exit = true) {
|
||||
$this->testUrl = Router::url($url);
|
||||
return false;
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ class AuthTestController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function isAuthorized() {
|
||||
public function isAuthorized() {
|
||||
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ class AjaxAuthController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeFilter() {
|
||||
public function beforeFilter() {
|
||||
$this->TestAuth->ajaxLogin = 'test_element';
|
||||
$this->TestAuth->userModel = 'AuthUser';
|
||||
$this->TestAuth->RequestHandler->ajaxLayout = 'ajax2';
|
||||
|
@ -270,7 +270,7 @@ class AjaxAuthController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function add() {
|
||||
public function add() {
|
||||
if ($this->TestAuth->testStop !== true) {
|
||||
echo 'Added Record';
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ class AjaxAuthController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function redirect($url, $status = null, $exit = true) {
|
||||
public function redirect($url, $status = null, $exit = true) {
|
||||
$this->testUrl = Router::url($url);
|
||||
return false;
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->_server = $_SERVER;
|
||||
$this->_env = $_ENV;
|
||||
|
@ -360,7 +360,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
$_SERVER = $this->_server;
|
||||
$_ENV = $this->_env;
|
||||
|
@ -376,7 +376,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testNoAuth() {
|
||||
public function testNoAuth() {
|
||||
$this->assertFalse($this->Auth->isAuthorized());
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testIsErrorOrTests() {
|
||||
public function testIsErrorOrTests() {
|
||||
$this->Controller->Auth->initialize($this->Controller);
|
||||
|
||||
$this->Controller->name = 'CakeError';
|
||||
|
@ -407,7 +407,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLogin() {
|
||||
public function testLogin() {
|
||||
$this->getMock('FormAuthenticate', array(), array(), 'AuthLoginFormAuthenticate', false);
|
||||
$this->Auth->authenticate = array(
|
||||
'AuthLoginForm' => array(
|
||||
|
@ -448,7 +448,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoginActionNotSettingAuthRedirect() {
|
||||
public function testLoginActionNotSettingAuthRedirect() {
|
||||
$_SERVER['HTTP_REFERER'] = '/pages/display/about';
|
||||
|
||||
$this->Controller->data = array();
|
||||
|
@ -471,7 +471,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAuthorizeFalse() {
|
||||
public function testAuthorizeFalse() {
|
||||
$this->AuthUser = new AuthUser();
|
||||
$user = $this->AuthUser->find();
|
||||
$this->Auth->Session->write('Auth.User', $user['AuthUser']);
|
||||
|
@ -495,7 +495,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @expectedException CakeException
|
||||
* @return void
|
||||
*/
|
||||
function testIsAuthorizedMissingFile() {
|
||||
public function testIsAuthorizedMissingFile() {
|
||||
$this->Controller->Auth->authorize = 'Missing';
|
||||
$this->Controller->Auth->isAuthorized(array('User' => array('id' => 1)));
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testIsAuthorizedDelegation() {
|
||||
public function testIsAuthorizedDelegation() {
|
||||
$this->getMock('BaseAuthorize', array('authorize'), array(), 'AuthMockOneAuthorize', false);
|
||||
$this->getMock('BaseAuthorize', array('authorize'), array(), 'AuthMockTwoAuthorize', false);
|
||||
$this->getMock('BaseAuthorize', array('authorize'), array(), 'AuthMockThreeAuthorize', false);
|
||||
|
@ -540,7 +540,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testIsAuthorizedUsingUserInSession() {
|
||||
public function testIsAuthorizedUsingUserInSession() {
|
||||
$this->getMock('BaseAuthorize', array('authorize'), array(), 'AuthMockFourAuthorize', false);
|
||||
$this->Auth->authorize = array('AuthMockFour');
|
||||
|
||||
|
@ -562,7 +562,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoadAuthorizeResets() {
|
||||
public function testLoadAuthorizeResets() {
|
||||
$this->Controller->Auth->authorize = array(
|
||||
'Controller'
|
||||
);
|
||||
|
@ -577,7 +577,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @expectedException CakeException
|
||||
* @return void
|
||||
*/
|
||||
function testLoadAuthenticateNoFile() {
|
||||
public function testLoadAuthenticateNoFile() {
|
||||
$this->Controller->Auth->authenticate = 'Missing';
|
||||
$this->Controller->Auth->identify($this->Controller->request, $this->Controller->response);
|
||||
}
|
||||
|
@ -587,7 +587,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAllConfigWithAuthorize() {
|
||||
public function testAllConfigWithAuthorize() {
|
||||
$this->Controller->Auth->authorize = array(
|
||||
AuthComponent::ALL => array('actionPath' => 'controllers/'),
|
||||
'Actions'
|
||||
|
@ -602,7 +602,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoadAuthenticateResets() {
|
||||
public function testLoadAuthenticateResets() {
|
||||
$this->Controller->Auth->authenticate = array(
|
||||
'Form'
|
||||
);
|
||||
|
@ -618,7 +618,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAllConfigWithAuthenticate() {
|
||||
public function testAllConfigWithAuthenticate() {
|
||||
$this->Controller->Auth->authenticate = array(
|
||||
AuthComponent::ALL => array('userModel' => 'AuthUser'),
|
||||
'Form'
|
||||
|
@ -634,7 +634,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAllowDenyAll() {
|
||||
public function testAllowDenyAll() {
|
||||
$this->Controller->Auth->initialize($this->Controller);
|
||||
|
||||
$this->Controller->Auth->allow('*');
|
||||
|
@ -661,7 +661,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDenyWithCamelCaseMethods() {
|
||||
public function testDenyWithCamelCaseMethods() {
|
||||
$this->Controller->Auth->initialize($this->Controller);
|
||||
$this->Controller->Auth->allow('*');
|
||||
$this->Controller->Auth->deny('add', 'camelCase');
|
||||
|
@ -678,7 +678,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAllowedActionsWithCamelCaseMethods() {
|
||||
public function testAllowedActionsWithCamelCaseMethods() {
|
||||
$url = '/auth_test/camelCase';
|
||||
$this->Controller->request->addParams(Router::parse($url));
|
||||
$this->Controller->request->query['url'] = Router::normalize($url);
|
||||
|
@ -715,7 +715,7 @@ class AuthTest extends CakeTestCase {
|
|||
$this->assertTrue($result, 'startup() should return true, as action is allowed. %s');
|
||||
}
|
||||
|
||||
function testAllowedActionsSetWithAllowMethod() {
|
||||
public function testAllowedActionsSetWithAllowMethod() {
|
||||
$url = '/auth_test/action_name';
|
||||
$this->Controller->request->addParams(Router::parse($url));
|
||||
$this->Controller->request->query['url'] = Router::normalize($url);
|
||||
|
@ -730,7 +730,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLoginRedirect() {
|
||||
public function testLoginRedirect() {
|
||||
$_SERVER['HTTP_REFERER'] = false;
|
||||
$_ENV['HTTP_REFERER'] = false;
|
||||
putenv('HTTP_REFERER=');
|
||||
|
@ -884,7 +884,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testNoRedirectOnLoginAction() {
|
||||
public function testNoRedirectOnLoginAction() {
|
||||
$controller = $this->getMock('Controller');
|
||||
$controller->methods = array('login');
|
||||
|
||||
|
@ -906,7 +906,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testNoRedirectOn404() {
|
||||
public function testNoRedirectOn404() {
|
||||
$this->Auth->Session->delete('Auth');
|
||||
$this->Auth->initialize($this->Controller);
|
||||
$this->Auth->request->addParams(Router::parse('auth_test/something_totally_wrong'));
|
||||
|
@ -920,7 +920,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAdminRoute() {
|
||||
public function testAdminRoute() {
|
||||
$prefixes = Configure::read('Routing.prefixes');
|
||||
Configure::write('Routing.prefixes', array('admin'));
|
||||
Router::reload();
|
||||
|
@ -949,7 +949,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAjaxLogin() {
|
||||
public function testAjaxLogin() {
|
||||
App::build(array(
|
||||
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||
));
|
||||
|
@ -972,7 +972,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLoginActionRedirect() {
|
||||
public function testLoginActionRedirect() {
|
||||
$admin = Configure::read('Routing.prefixes');
|
||||
Configure::write('Routing.prefixes', array('admin'));
|
||||
Router::reload();
|
||||
|
@ -1006,7 +1006,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testShutDown() {
|
||||
public function testShutDown() {
|
||||
$this->Auth->Session->write('Auth.User', 'not empty');
|
||||
$this->Auth->Session->write('Auth.redirect', 'foo');
|
||||
$this->Controller->Auth->loggedIn(true);
|
||||
|
@ -1021,7 +1021,7 @@ class AuthTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testComponentSettings() {
|
||||
public function testComponentSettings() {
|
||||
$request = new CakeRequest(null, false);
|
||||
$this->Controller = new AuthTestController($request);
|
||||
|
||||
|
@ -1049,7 +1049,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLogout() {
|
||||
public function testLogout() {
|
||||
$this->Auth->Session->write('Auth.User.id', '1');
|
||||
$this->Auth->Session->write('Auth.redirect', '/users/login');
|
||||
$this->Auth->logoutRedirect = '/';
|
||||
|
@ -1065,7 +1065,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMapActionsDelegation() {
|
||||
public function testMapActionsDelegation() {
|
||||
$this->getMock('BaseAuthorize', array('authorize'), array(), 'MapActionMockAuthorize', false);
|
||||
$this->Auth->authorize = array('MapActionMock');
|
||||
$mock = $this->Auth->constructAuthorize();
|
||||
|
@ -1081,7 +1081,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoginWithRequestData() {
|
||||
public function testLoginWithRequestData() {
|
||||
$this->getMock('FormAuthenticate', array(), array(), 'RequestLoginMockAuthenticate', false);
|
||||
$request = new CakeRequest('users/login', false);
|
||||
$user = array('username' => 'mark', 'role' => 'admin');
|
||||
|
@ -1103,7 +1103,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoginWithUserData() {
|
||||
public function testLoginWithUserData() {
|
||||
$this->assertFalse($this->Auth->loggedIn());
|
||||
|
||||
$user = array(
|
||||
|
@ -1122,7 +1122,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testFlashSettings() {
|
||||
public function testFlashSettings() {
|
||||
$this->Auth->Session = $this->getMock('SessionComponent', array(), array(), '', false);
|
||||
$this->Auth->Session->expects($this->once())
|
||||
->method('setFlash')
|
||||
|
@ -1141,7 +1141,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRedirectSet() {
|
||||
public function testRedirectSet() {
|
||||
$value = array('controller' => 'users', 'action' => 'home');
|
||||
$result = $this->Auth->redirect($value);
|
||||
$this->assertEquals('/users/home', $result);
|
||||
|
@ -1153,7 +1153,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRedirectSessionRead() {
|
||||
public function testRedirectSessionRead() {
|
||||
$this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
|
||||
$this->Auth->Session->write('Auth.redirect', '/users/home');
|
||||
|
||||
|
@ -1168,7 +1168,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRedirectSessionReadEqualToLoginAction() {
|
||||
public function testRedirectSessionReadEqualToLoginAction() {
|
||||
$this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
|
||||
$this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'home');
|
||||
$this->Auth->Session->write('Auth.redirect', array('controller' => 'users', 'action' => 'login'));
|
||||
|
@ -1183,7 +1183,7 @@ class AuthTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPassword() {
|
||||
public function testPassword() {
|
||||
$result = $this->Auth->password('password');
|
||||
$expected = Security::hash('password', null, true);
|
||||
$this->assertEquals($expected, $result);
|
||||
|
|
|
@ -43,7 +43,7 @@ class CookieComponentTestController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeFilter() {
|
||||
public function beforeFilter() {
|
||||
$this->Cookie->name = 'CakeTestCookie';
|
||||
$this->Cookie->time = 10;
|
||||
$this->Cookie->path = '/';
|
||||
|
@ -74,7 +74,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
$_COOKIE = array();
|
||||
$Collection = new ComponentCollection();
|
||||
$this->Cookie = $this->getMock('CookieComponent', array('_setcookie'), array($Collection));
|
||||
|
@ -97,7 +97,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
$this->Cookie->destroy();
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSettings() {
|
||||
public function testSettings() {
|
||||
$settings = array(
|
||||
'time' => '5 days',
|
||||
'path' => '/'
|
||||
|
@ -139,7 +139,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCookieName() {
|
||||
public function testCookieName() {
|
||||
$this->assertEqual($this->Cookie->name, 'CakeTestCookie');
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadEncryptedCookieData() {
|
||||
public function testReadEncryptedCookieData() {
|
||||
$this->_setCookieData();
|
||||
$data = $this->Cookie->read('Encrytped_array');
|
||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
||||
|
@ -166,7 +166,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadPlainCookieData() {
|
||||
public function testReadPlainCookieData() {
|
||||
$this->_setCookieData();
|
||||
|
||||
$data = $this->Cookie->read('Plain_array');
|
||||
|
@ -183,7 +183,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testWriteSimple() {
|
||||
public function testWriteSimple() {
|
||||
$this->Cookie->expects($this->once())->method('_setcookie');
|
||||
|
||||
$this->Cookie->write('Testing', 'value');
|
||||
|
@ -197,7 +197,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testWriteHttpOnly() {
|
||||
public function testWriteHttpOnly() {
|
||||
$this->Cookie->httpOnly = true;
|
||||
$this->Cookie->secure = false;
|
||||
$this->Cookie->expects($this->once())->method('_setcookie')
|
||||
|
@ -211,7 +211,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDeleteHttpOnly() {
|
||||
public function testDeleteHttpOnly() {
|
||||
$this->Cookie->httpOnly = true;
|
||||
$this->Cookie->secure = false;
|
||||
$this->Cookie->expects($this->once())->method('_setcookie')
|
||||
|
@ -226,7 +226,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testWritePlainCookieArray() {
|
||||
public function testWritePlainCookieArray() {
|
||||
$this->Cookie->write(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!'), null, false);
|
||||
|
||||
$this->assertEqual($this->Cookie->read('name'), 'CakePHP');
|
||||
|
@ -243,7 +243,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testWriteArrayValues() {
|
||||
public function testWriteArrayValues() {
|
||||
$this->Cookie->secure = false;
|
||||
$this->Cookie->expects($this->once())->method('_setcookie')
|
||||
->with('CakeTestCookie[Testing]', '[1,2,3]', time() + 10, '/', '', false, false);
|
||||
|
@ -257,7 +257,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadingCookieValue() {
|
||||
public function testReadingCookieValue() {
|
||||
$this->_setCookieData();
|
||||
$data = $this->Cookie->read();
|
||||
$expected = array(
|
||||
|
@ -286,7 +286,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDeleteCookieValue() {
|
||||
public function testDeleteCookieValue() {
|
||||
$this->_setCookieData();
|
||||
$this->Cookie->delete('Encrytped_multi_cookies.name');
|
||||
$data = $this->Cookie->read('Encrytped_multi_cookies');
|
||||
|
@ -313,7 +313,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadingCookieArray() {
|
||||
public function testReadingCookieArray() {
|
||||
$this->_setCookieData();
|
||||
|
||||
$data = $this->Cookie->read('Encrytped_array.name');
|
||||
|
@ -371,7 +371,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadingCookieDataOnStartup() {
|
||||
public function testReadingCookieDataOnStartup() {
|
||||
$data = $this->Cookie->read('Encrytped_array');
|
||||
$this->assertNull($data);
|
||||
|
||||
|
@ -423,7 +423,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadingCookieDataWithoutStartup() {
|
||||
public function testReadingCookieDataWithoutStartup() {
|
||||
$data = $this->Cookie->read('Encrytped_array');
|
||||
$expected = null;
|
||||
$this->assertEquals($expected, $data);
|
||||
|
@ -476,7 +476,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testReadLegacyCookieValue() {
|
||||
public function testReadLegacyCookieValue() {
|
||||
$_COOKIE['CakeTestCookie'] = array(
|
||||
'Legacy' => array('value' => $this->_oldImplode(array(1, 2, 3)))
|
||||
);
|
||||
|
@ -490,7 +490,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testNoErrorOnNonArrayData() {
|
||||
public function testNoErrorOnNonArrayData() {
|
||||
$this->Cookie->destroy();
|
||||
$_COOKIE['CakeTestCookie'] = 'kaboom';
|
||||
|
||||
|
@ -502,7 +502,7 @@ class CookieComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDeleteRemovesChildren() {
|
||||
public function testDeleteRemovesChildren() {
|
||||
$_COOKIE['CakeTestCookie'] = array(
|
||||
'User' => array('email' => 'example@example.com', 'name' => 'mark'),
|
||||
'other' => 'value'
|
||||
|
|
|
@ -35,7 +35,7 @@ class EmailTestComponent extends EmailComponent {
|
|||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function strip($content, $message = false) {
|
||||
public function strip($content, $message = false) {
|
||||
return parent::_strip($content, $message);
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ class EmailComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
$this->_appEncoding = Configure::read('App.encoding');
|
||||
Configure::write('App.encoding', 'UTF-8');
|
||||
|
||||
|
@ -167,7 +167,7 @@ class EmailComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
Configure::write('App.encoding', $this->_appEncoding);
|
||||
App::build();
|
||||
ClassRegistry::flush();
|
||||
|
@ -190,7 +190,7 @@ class EmailComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSendFormats() {
|
||||
public function testSendFormats() {
|
||||
$this->Controller->EmailTest->to = 'postmaster@example.com';
|
||||
$this->Controller->EmailTest->from = 'noreply@example.com';
|
||||
$this->Controller->EmailTest->subject = 'Cake SMTP test';
|
||||
|
@ -242,7 +242,7 @@ MSGBLOC;
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testTemplates() {
|
||||
public function testTemplates() {
|
||||
ClassRegistry::flush();
|
||||
|
||||
$this->Controller->EmailTest->to = 'postmaster@example.com';
|
||||
|
@ -343,7 +343,7 @@ HTMLBLOC;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testTemplateNestedElements() {
|
||||
public function testTemplateNestedElements() {
|
||||
$this->Controller->EmailTest->to = 'postmaster@example.com';
|
||||
$this->Controller->EmailTest->from = 'noreply@example.com';
|
||||
$this->Controller->EmailTest->subject = 'Cake SMTP test';
|
||||
|
@ -368,7 +368,7 @@ HTMLBLOC;
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSendDebug() {
|
||||
public function testSendDebug() {
|
||||
$this->Controller->EmailTest->to = 'postmaster@example.com';
|
||||
$this->Controller->EmailTest->from = 'noreply@example.com';
|
||||
$this->Controller->EmailTest->cc = 'cc@example.com';
|
||||
|
@ -399,7 +399,7 @@ HTMLBLOC;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSendDebugWithNoSessions() {
|
||||
public function testSendDebugWithNoSessions() {
|
||||
$session = $this->Controller->Session;
|
||||
unset($this->Controller->Session);
|
||||
$this->Controller->EmailTest->to = 'postmaster@example.com';
|
||||
|
@ -430,7 +430,7 @@ HTMLBLOC;
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMessageRetrievalWithoutTemplate() {
|
||||
public function testMessageRetrievalWithoutTemplate() {
|
||||
App::build(array(
|
||||
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||
));
|
||||
|
@ -468,7 +468,7 @@ HTMLBLOC;
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMessageRetrievalWithTemplate() {
|
||||
public function testMessageRetrievalWithTemplate() {
|
||||
App::build(array(
|
||||
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||
));
|
||||
|
@ -528,7 +528,7 @@ HTMLBLOC;
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSendContentArray() {
|
||||
public function testSendContentArray() {
|
||||
$this->Controller->EmailTest->to = 'postmaster@example.com';
|
||||
$this->Controller->EmailTest->from = 'noreply@example.com';
|
||||
$this->Controller->EmailTest->subject = 'Cake Debug Test';
|
||||
|
@ -557,7 +557,7 @@ HTMLBLOC;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDateProperty() {
|
||||
public function testDateProperty() {
|
||||
$this->Controller->EmailTest->to = 'postmaster@example.com';
|
||||
$this->Controller->EmailTest->from = 'noreply@example.com';
|
||||
$this->Controller->EmailTest->subject = 'Cake Debug Test';
|
||||
|
@ -576,7 +576,7 @@ HTMLBLOC;
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testContentStripping() {
|
||||
public function testContentStripping() {
|
||||
$content = "Previous content\n--alt-\nContent-TypeContent-Type:: text/html; charsetcharset==utf-8\nContent-Transfer-Encoding: 7bit";
|
||||
$content .= "\n\n<p>My own html content</p>";
|
||||
|
||||
|
@ -601,7 +601,7 @@ HTMLBLOC;
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function test_encodeSettingInternalCharset() {
|
||||
public function test_encodeSettingInternalCharset() {
|
||||
$skip = !function_exists('mb_internal_encoding');
|
||||
if ($this->skipIf($skip, 'Missing mb_* functions, cannot run test.')) {
|
||||
return;
|
||||
|
@ -637,7 +637,7 @@ HTMLBLOC;
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyte() {
|
||||
public function testMultibyte() {
|
||||
$this->Controller->charset = 'UTF-8';
|
||||
$this->Controller->EmailTest->to = 'postmaster@example.com';
|
||||
$this->Controller->EmailTest->from = 'noreply@example.com';
|
||||
|
@ -753,7 +753,7 @@ HTMLBLOC;
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReset() {
|
||||
public function testReset() {
|
||||
$this->Controller->EmailTest->template = 'default';
|
||||
$this->Controller->EmailTest->to = 'test.recipient@example.com';
|
||||
$this->Controller->EmailTest->from = 'test.sender@example.com';
|
||||
|
@ -797,7 +797,7 @@ HTMLBLOC;
|
|||
$this->assertTrue($this->Controller->EmailTest->messageId);
|
||||
}
|
||||
|
||||
function testPluginCustomViewClass() {
|
||||
public function testPluginCustomViewClass() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||
|
@ -824,7 +824,7 @@ HTMLBLOC;
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testStartup() {
|
||||
public function testStartup() {
|
||||
$this->assertNull($this->Controller->EmailTest->startup($this->Controller));
|
||||
}
|
||||
|
||||
|
@ -834,7 +834,7 @@ HTMLBLOC;
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMessageId() {
|
||||
public function testMessageId() {
|
||||
$this->Controller->EmailTest->to = 'postmaster@example.com';
|
||||
$this->Controller->EmailTest->from = 'noreply@example.com';
|
||||
$this->Controller->EmailTest->subject = 'Cake Debug Test';
|
||||
|
|
|
@ -101,7 +101,7 @@ class PaginatorControllerPost extends CakeTestModel {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeFind($query) {
|
||||
public function beforeFind($query) {
|
||||
$this->lastQuery = $query;
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ class PaginatorControllerPost extends CakeTestModel {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function find($conditions = null, $fields = array(), $order = null, $recursive = null) {
|
||||
public function find($conditions = null, $fields = array(), $order = null, $recursive = null) {
|
||||
if ($conditions == 'popular') {
|
||||
$conditions = array($this->name . '.' . $this->primaryKey .' > ' => '1');
|
||||
$options = Set::merge($fields, compact('conditions'));
|
||||
|
@ -161,7 +161,7 @@ class ControllerPaginateModel extends CakeTestModel {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function paginateCount($conditions, $recursive, $extra) {
|
||||
public function paginateCount($conditions, $recursive, $extra) {
|
||||
$this->extraCount = $extra;
|
||||
}
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->request = new CakeRequest('controller_posts/index');
|
||||
$this->request->params['pass'] = $this->request->params['named'] = array();
|
||||
|
@ -230,7 +230,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPaginate() {
|
||||
public function testPaginate() {
|
||||
$Controller = new PaginatorTestController($this->request);
|
||||
$Controller->uses = array('PaginatorControllerPost', 'PaginatorControllerComment');
|
||||
$Controller->request->params['pass'] = array('1');
|
||||
|
@ -313,7 +313,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPageParamCasting() {
|
||||
public function testPageParamCasting() {
|
||||
$this->Controller->Post->expects($this->at(0))
|
||||
->method('hasMethod')
|
||||
->with('paginateCount')
|
||||
|
@ -344,7 +344,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPaginateExtraParams() {
|
||||
public function testPaginateExtraParams() {
|
||||
$Controller = new PaginatorTestController($this->request);
|
||||
|
||||
$Controller->uses = array('PaginatorControllerPost', 'PaginatorControllerComment');
|
||||
|
@ -435,7 +435,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPaginateSpecialType() {
|
||||
public function testPaginateSpecialType() {
|
||||
$Controller = new PaginatorTestController($this->request);
|
||||
$Controller->uses = array('PaginatorControllerPost', 'PaginatorControllerComment');
|
||||
$Controller->passedArgs[] = '1';
|
||||
|
@ -466,7 +466,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDefaultPaginateParams() {
|
||||
public function testDefaultPaginateParams() {
|
||||
$Controller = new PaginatorTestController($this->request);
|
||||
$Controller->modelClass = 'PaginatorControllerPost';
|
||||
$Controller->params['url'] = array();
|
||||
|
@ -486,7 +486,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPaginateOrderVirtualField() {
|
||||
public function testPaginateOrderVirtualField() {
|
||||
$Controller = new PaginatorTestController($this->request);
|
||||
$Controller->uses = array('PaginatorControllerPost', 'PaginatorControllerComment');
|
||||
$Controller->params['url'] = array();
|
||||
|
@ -514,7 +514,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @expectedException MissingModelException
|
||||
*/
|
||||
function testPaginateMissingModel() {
|
||||
public function testPaginateMissingModel() {
|
||||
$Controller = new PaginatorTestController($this->request);
|
||||
$Controller->constructClasses();
|
||||
$Controller->Paginator->paginate('MissingModel');
|
||||
|
@ -525,7 +525,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMergeOptionsModelSpecific() {
|
||||
public function testMergeOptionsModelSpecific() {
|
||||
$this->Paginator->settings = array(
|
||||
'page' => 1,
|
||||
'limit' => 20,
|
||||
|
@ -551,7 +551,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMergeOptionsNamedParams() {
|
||||
public function testMergeOptionsNamedParams() {
|
||||
$this->request->params['named'] = array(
|
||||
'page' => 10,
|
||||
'limit' => 10
|
||||
|
@ -572,7 +572,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMergeOptionsQueryString() {
|
||||
public function testMergeOptionsQueryString() {
|
||||
$this->request->params['named'] = array(
|
||||
'page' => 10,
|
||||
'limit' => 10
|
||||
|
@ -597,7 +597,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMergeOptionsDefaultWhiteList() {
|
||||
public function testMergeOptionsDefaultWhiteList() {
|
||||
$this->request->params['named'] = array(
|
||||
'page' => 10,
|
||||
'limit' => 10,
|
||||
|
@ -622,7 +622,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMergeOptionsExtraWhitelist() {
|
||||
public function testMergeOptionsExtraWhitelist() {
|
||||
$this->request->params['named'] = array(
|
||||
'page' => 10,
|
||||
'limit' => 10,
|
||||
|
@ -650,7 +650,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testValidateSortInvalidDirection() {
|
||||
public function testValidateSortInvalidDirection() {
|
||||
$model = $this->getMock('Model');
|
||||
$model->alias = 'model';
|
||||
$model->expects($this->any())->method('hasField')->will($this->returnValue(true));
|
||||
|
@ -666,7 +666,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testValidateSortWhitelistFailure() {
|
||||
public function testValidateSortWhitelistFailure() {
|
||||
$model = $this->getMock('Model');
|
||||
$model->alias = 'model';
|
||||
$model->expects($this->any())->method('hasField')->will($this->returnValue(true));
|
||||
|
@ -682,7 +682,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testValidateSortVirtualField() {
|
||||
public function testValidateSortVirtualField() {
|
||||
$model = $this->getMock('Model');
|
||||
$model->alias = 'model';
|
||||
|
||||
|
@ -707,7 +707,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCheckLimit() {
|
||||
public function testCheckLimit() {
|
||||
$result = $this->Paginator->checkLimit(array('limit' => 1000000, 'maxLimit' => 100));
|
||||
$this->assertEquals(100, $result['limit']);
|
||||
|
||||
|
@ -730,7 +730,7 @@ class PaginatorTest extends CakeTestCase {
|
|||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testPaginateMaxLimit() {
|
||||
public function testPaginateMaxLimit() {
|
||||
$Controller = new Controller($this->request);
|
||||
|
||||
$Controller->uses = array('PaginatorControllerPost', 'ControllerComment');
|
||||
|
|
|
@ -50,7 +50,7 @@ class RequestHandlerTestController extends Controller {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function destination() {
|
||||
public function destination() {
|
||||
$this->viewPath = 'Posts';
|
||||
$this->render('index');
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ class RequestHandlerTestController extends Controller {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function param_method($one = null, $two = null) {
|
||||
public function param_method($one = null, $two = null) {
|
||||
echo "one: $one two: $two";
|
||||
$this->autoRender = false;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ class RequestHandlerTestController extends Controller {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function ajax2_layout() {
|
||||
public function ajax2_layout() {
|
||||
if ($this->autoLayout) {
|
||||
$this->layout = 'ajax2';
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
$this->_server = $_SERVER;
|
||||
$this->_init();
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
unset($this->RequestHandler);
|
||||
unset($this->Controller);
|
||||
if (!headers_sent()) {
|
||||
|
@ -172,7 +172,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConstructorSettings() {
|
||||
public function testConstructorSettings() {
|
||||
$settings = array(
|
||||
'ajaxLayout' => 'test_ajax'
|
||||
);
|
||||
|
@ -187,7 +187,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testInitializeCallback() {
|
||||
public function testInitializeCallback() {
|
||||
$this->assertNull($this->RequestHandler->ext);
|
||||
$this->Controller->request->params['url']['ext'] = 'rss';
|
||||
$this->RequestHandler->initialize($this->Controller);
|
||||
|
@ -199,7 +199,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testInitializeContentTypeSettingExt() {
|
||||
public function testInitializeContentTypeSettingExt() {
|
||||
$this->assertNull($this->RequestHandler->ext);
|
||||
$extensions = Router::extensions();
|
||||
Router::parseExtensions('json');
|
||||
|
@ -218,7 +218,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testInitializeContentTypeAndExtensionMismatch() {
|
||||
public function testInitializeContentTypeAndExtensionMismatch() {
|
||||
$this->assertNull($this->RequestHandler->ext);
|
||||
$extensions = Router::extensions();
|
||||
Router::parseExtensions('xml');
|
||||
|
@ -239,7 +239,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDisabling() {
|
||||
public function testDisabling() {
|
||||
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
|
||||
$this->_init();
|
||||
$this->RequestHandler->initialize($this->Controller);
|
||||
|
@ -254,7 +254,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAutoResponseType() {
|
||||
public function testAutoResponseType() {
|
||||
$this->Controller->ext = '.thtml';
|
||||
$this->Controller->request->params['url']['ext'] = 'rss';
|
||||
$this->RequestHandler->initialize($this->Controller);
|
||||
|
@ -269,7 +269,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAutoAjaxLayout() {
|
||||
public function testAutoAjaxLayout() {
|
||||
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
|
||||
$this->RequestHandler->startup($this->Controller);
|
||||
$this->assertEquals($this->Controller->layout, $this->RequestHandler->ajaxLayout);
|
||||
|
@ -289,7 +289,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testStartupCallback() {
|
||||
public function testStartupCallback() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'PUT';
|
||||
$_SERVER['CONTENT_TYPE'] = 'application/xml';
|
||||
$this->Controller->request = $this->getMock('CakeRequest', array('_readStdin'));
|
||||
|
@ -303,7 +303,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testStartupCallbackCharset() {
|
||||
public function testStartupCallbackCharset() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'PUT';
|
||||
$_SERVER['CONTENT_TYPE'] = 'application/xml; charset=UTF-8';
|
||||
$this->Controller->request = $this->getMock('CakeRequest', array('_readStdin'));
|
||||
|
@ -317,7 +317,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testStartupCustomTypeProcess() {
|
||||
public function testStartupCustomTypeProcess() {
|
||||
if (!function_exists('str_getcsv')) {
|
||||
$this->markTestSkipped('Need "str_getcsv" for this test.');
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testNonAjaxRedirect() {
|
||||
public function testNonAjaxRedirect() {
|
||||
$this->RequestHandler->initialize($this->Controller);
|
||||
$this->RequestHandler->startup($this->Controller);
|
||||
$this->assertNull($this->RequestHandler->beforeRedirect($this->Controller, '/'));
|
||||
|
@ -353,7 +353,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRenderAs() {
|
||||
public function testRenderAs() {
|
||||
$this->assertFalse(in_array('Rss', $this->Controller->helpers));
|
||||
$this->RequestHandler->renderAs($this->Controller, 'rss');
|
||||
$this->assertTrue(in_array('Rss', $this->Controller->helpers));
|
||||
|
@ -368,7 +368,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRenderAsWithAttachment() {
|
||||
public function testRenderAsWithAttachment() {
|
||||
$this->RequestHandler->request = $this->getMock('CakeRequest');
|
||||
$this->RequestHandler->request->expects($this->any())
|
||||
->method('accepts')
|
||||
|
@ -396,7 +396,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRespondAs() {
|
||||
public function testRespondAs() {
|
||||
$this->RequestHandler->response = $this->getMock('CakeResponse', array('type'));
|
||||
$this->RequestHandler->response->expects($this->at(0))->method('type')
|
||||
->with('application/json');
|
||||
|
@ -415,7 +415,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRespondAsWithAttachment() {
|
||||
public function testRespondAsWithAttachment() {
|
||||
$this->RequestHandler = $this->getMock(
|
||||
'RequestHandlerComponent',
|
||||
array('_header'),
|
||||
|
@ -443,7 +443,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @link #6466
|
||||
* @return void
|
||||
*/
|
||||
function testRenderAsCalledTwice() {
|
||||
public function testRenderAsCalledTwice() {
|
||||
$this->RequestHandler->renderAs($this->Controller, 'xml');
|
||||
$this->assertEqual($this->Controller->viewPath, 'RequestHandlerTest' . DS . 'xml');
|
||||
$this->assertEqual($this->Controller->layoutPath, 'xml');
|
||||
|
@ -460,7 +460,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequestClientTypes() {
|
||||
public function testRequestClientTypes() {
|
||||
$_SERVER['HTTP_X_PROTOTYPE_VERSION'] = '1.5';
|
||||
$this->assertEqual($this->RequestHandler->getAjaxVersion(), '1.5');
|
||||
|
||||
|
@ -474,7 +474,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFlashDetection() {
|
||||
public function testFlashDetection() {
|
||||
$request = $this->getMock('CakeRequest');
|
||||
$request->expects($this->once())->method('is')
|
||||
->with('flash')
|
||||
|
@ -490,7 +490,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequestContentTypes() {
|
||||
public function testRequestContentTypes() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$this->assertNull($this->RequestHandler->requestedWith());
|
||||
|
||||
|
@ -530,7 +530,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testResponseContentType() {
|
||||
public function testResponseContentType() {
|
||||
$this->assertEquals('html', $this->RequestHandler->responseType());
|
||||
$this->assertTrue($this->RequestHandler->respondAs('atom'));
|
||||
$this->assertEqual($this->RequestHandler->responseType(), 'atom');
|
||||
|
@ -542,7 +542,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMobileDeviceDetection() {
|
||||
public function testMobileDeviceDetection() {
|
||||
$request = $this->getMock('CakeRequest');
|
||||
$request->expects($this->once())->method('is')
|
||||
->with('mobile')
|
||||
|
@ -558,7 +558,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequestProperties() {
|
||||
public function testRequestProperties() {
|
||||
$request = $this->getMock('CakeRequest');
|
||||
$request->expects($this->once())->method('is')
|
||||
->with('ssl')
|
||||
|
@ -574,7 +574,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequestMethod() {
|
||||
public function testRequestMethod() {
|
||||
$request = $this->getMock('CakeRequest');
|
||||
$request->expects($this->at(0))->method('is')
|
||||
->with('get')
|
||||
|
@ -604,7 +604,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMapAlias() {
|
||||
public function testMapAlias() {
|
||||
$result = $this->RequestHandler->mapAlias('xml');
|
||||
$this->assertEquals('application/xml', $result);
|
||||
|
||||
|
@ -624,7 +624,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAccepts() {
|
||||
public function testAccepts() {
|
||||
$_SERVER['HTTP_ACCEPT'] = 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5';
|
||||
$this->assertEqual($this->RequestHandler->accepts(array('js', 'xml', 'html')), 'xml');
|
||||
$this->assertFalse($this->RequestHandler->accepts(array('gif', 'jpeg', 'foo')));
|
||||
|
@ -639,7 +639,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPrefers() {
|
||||
public function testPrefers() {
|
||||
$_SERVER['HTTP_ACCEPT'] = 'text/xml,application/xml,application/xhtml+xml,text/html,text/plain,image/png,*/*';
|
||||
$this->assertNotEqual($this->RequestHandler->prefers(), 'rss');
|
||||
$this->RequestHandler->ext = 'rss';
|
||||
|
@ -664,7 +664,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCustomContent() {
|
||||
public function testCustomContent() {
|
||||
$_SERVER['HTTP_ACCEPT'] = 'text/x-mobile,text/html;q=0.9,text/plain;q=0.8,*/*;q=0.5';
|
||||
$this->RequestHandler->setContent('mobile', 'text/x-mobile');
|
||||
$this->RequestHandler->startup($this->Controller);
|
||||
|
@ -677,7 +677,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testClientProperties() {
|
||||
public function testClientProperties() {
|
||||
$request = $this->getMock('CakeRequest');
|
||||
$request->expects($this->once())->method('referer');
|
||||
$request->expects($this->once())->method('clientIp')->will($this->returnValue(false));
|
||||
|
@ -693,7 +693,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAjaxRedirectAsRequestAction() {
|
||||
public function testAjaxRedirectAsRequestAction() {
|
||||
App::build(array(
|
||||
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||
), true);
|
||||
|
@ -722,7 +722,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAjaxRedirectAsRequestActionStillRenderingLayout() {
|
||||
public function testAjaxRedirectAsRequestActionStillRenderingLayout() {
|
||||
App::build(array(
|
||||
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||
), true);
|
||||
|
@ -754,7 +754,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @link http://cakephp.lighthouseapp.com/projects/42648-cakephp-1x/tickets/276
|
||||
* @return void
|
||||
*/
|
||||
function testBeforeRedirectCallbackWithArrayUrl() {
|
||||
public function testBeforeRedirectCallbackWithArrayUrl() {
|
||||
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
|
||||
|
||||
Router::setRequestInfo(array(
|
||||
|
@ -781,7 +781,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testBeforeRedirectCallingHeader() {
|
||||
public function testBeforeRedirectCallingHeader() {
|
||||
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
|
||||
|
||||
$controller = $this->getMock('Controller', array('header'));
|
||||
|
@ -803,7 +803,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* @expectedException CakeException
|
||||
* @return void
|
||||
*/
|
||||
function testAddInputTypeException() {
|
||||
public function testAddInputTypeException() {
|
||||
$this->RequestHandler->addInputType('csv', array('I am not callable'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class TestSecurityComponent extends SecurityComponent {
|
|||
* @param Controller $controller
|
||||
* @return unknown
|
||||
*/
|
||||
function validatePost($controller) {
|
||||
public function validatePost($controller) {
|
||||
return $this->_validatePost($controller);
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ class SecurityTestController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function fail() {
|
||||
public function fail() {
|
||||
$this->failed = true;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ class SecurityTestController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function redirect($url, $status = null, $exit = true) {
|
||||
public function redirect($url, $status = null, $exit = true) {
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$request = new CakeRequest('posts/index', false);
|
||||
|
@ -162,7 +162,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
$this->Controller->Session->delete('_Token');
|
||||
unset($this->Controller->Security);
|
||||
|
@ -175,7 +175,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConstructorSettingProperties() {
|
||||
public function testConstructorSettingProperties() {
|
||||
$settings = array(
|
||||
'requirePost' => array('edit', 'update'),
|
||||
'requireSecure' => array('update_account'),
|
||||
|
@ -196,7 +196,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testStartup() {
|
||||
public function testStartup() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$result = $this->Controller->params['_Token']['key'];
|
||||
$this->assertNotNull($result);
|
||||
|
@ -209,7 +209,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequirePostFail() {
|
||||
public function testRequirePostFail() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$this->Controller->request['action'] = 'posted';
|
||||
$this->Controller->Security->requirePost(array('posted'));
|
||||
|
@ -223,7 +223,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequirePostSucceed() {
|
||||
public function testRequirePostSucceed() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
$this->Controller->request['action'] = 'posted';
|
||||
$this->Controller->Security->requirePost('posted');
|
||||
|
@ -237,7 +237,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequireSecureFail() {
|
||||
public function testRequireSecureFail() {
|
||||
$_SERVER['HTTPS'] = 'off';
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
$this->Controller->request['action'] = 'posted';
|
||||
|
@ -252,7 +252,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequireSecureSucceed() {
|
||||
public function testRequireSecureSucceed() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'Secure';
|
||||
$this->Controller->request['action'] = 'posted';
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
|
@ -267,7 +267,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequireAuthFail() {
|
||||
public function testRequireAuthFail() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'AUTH';
|
||||
$this->Controller->request['action'] = 'posted';
|
||||
$this->Controller->request->data = array('username' => 'willy', 'password' => 'somePass');
|
||||
|
@ -298,7 +298,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequireAuthSucceed() {
|
||||
public function testRequireAuthSucceed() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'AUTH';
|
||||
$this->Controller->request['action'] = 'posted';
|
||||
$this->Controller->Security->requireAuth('posted');
|
||||
|
@ -326,7 +326,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequirePostSucceedWrongMethod() {
|
||||
public function testRequirePostSucceedWrongMethod() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$this->Controller->request['action'] = 'getted';
|
||||
$this->Controller->Security->requirePost('posted');
|
||||
|
@ -340,7 +340,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequireGetFail() {
|
||||
public function testRequireGetFail() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
$this->Controller->request['action'] = 'getted';
|
||||
$this->Controller->Security->requireGet(array('getted'));
|
||||
|
@ -354,7 +354,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequireGetSucceed() {
|
||||
public function testRequireGetSucceed() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$this->Controller->request['action'] = 'getted';
|
||||
$this->Controller->Security->requireGet('getted');
|
||||
|
@ -368,7 +368,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequireGetSucceedWrongMethod() {
|
||||
public function testRequireGetSucceedWrongMethod() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
$this->Controller->request['action'] = 'posted';
|
||||
$this->Security->requireGet('getted');
|
||||
|
@ -382,7 +382,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequirePutFail() {
|
||||
public function testRequirePutFail() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
$this->Controller->request['action'] = 'putted';
|
||||
$this->Controller->Security->requirePut(array('putted'));
|
||||
|
@ -396,7 +396,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequirePutSucceed() {
|
||||
public function testRequirePutSucceed() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'PUT';
|
||||
$this->Controller->request['action'] = 'putted';
|
||||
$this->Controller->Security->requirePut('putted');
|
||||
|
@ -410,7 +410,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequirePutSucceedWrongMethod() {
|
||||
public function testRequirePutSucceedWrongMethod() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
$this->Controller->request['action'] = 'posted';
|
||||
$this->Controller->Security->requirePut('putted');
|
||||
|
@ -424,7 +424,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequireDeleteFail() {
|
||||
public function testRequireDeleteFail() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
$this->Controller->request['action'] = 'deleted';
|
||||
$this->Controller->Security->requireDelete(array('deleted', 'other_method'));
|
||||
|
@ -438,7 +438,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequireDeleteSucceed() {
|
||||
public function testRequireDeleteSucceed() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'DELETE';
|
||||
$this->Controller->request['action'] = 'deleted';
|
||||
$this->Controller->Security->requireDelete('deleted');
|
||||
|
@ -452,7 +452,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequireDeleteSucceedWrongMethod() {
|
||||
public function testRequireDeleteSucceedWrongMethod() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
$this->Controller->request['action'] = 'posted';
|
||||
$this->Controller->Security->requireDelete('deleted');
|
||||
|
@ -466,7 +466,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidatePost() {
|
||||
public function testValidatePost() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
|
@ -484,7 +484,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testValidatePostFormHacking() {
|
||||
public function testValidatePostFormHacking() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->params['_Token']['key'];
|
||||
$fields = 'a5475372b40f6e3ccbf9f8af191f20e1642fd877%3AModel.valid';
|
||||
|
@ -503,7 +503,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testValidatePostObjectDeserialize() {
|
||||
public function testValidatePostObjectDeserialize() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
$fields = 'a5475372b40f6e3ccbf9f8af191f20e1642fd877';
|
||||
|
@ -526,7 +526,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidatePostArray() {
|
||||
public function testValidatePostArray() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
|
@ -545,7 +545,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidatePostNoModel() {
|
||||
public function testValidatePostNoModel() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
|
@ -566,7 +566,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidatePostSimple() {
|
||||
public function testValidatePostSimple() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
|
@ -587,7 +587,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidatePostComplex() {
|
||||
public function testValidatePostComplex() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
|
@ -615,7 +615,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testValidatePostMultipleSelect() {
|
||||
public function testValidatePostMultipleSelect() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
|
@ -660,7 +660,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidatePostCheckbox() {
|
||||
public function testValidatePostCheckbox() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
$fields = 'a5475372b40f6e3ccbf9f8af191f20e1642fd877%3AModel.valid';
|
||||
|
@ -703,7 +703,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidatePostHidden() {
|
||||
public function testValidatePostHidden() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
$fields = '51ccd8cb0997c7b3d4523ecde5a109318405ef8c%3AModel.hidden%7CModel.other_hidden';
|
||||
|
@ -726,7 +726,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidatePostWithDisabledFields() {
|
||||
public function testValidatePostWithDisabledFields() {
|
||||
$this->Controller->Security->disabledFields = array('Model.username', 'Model.password');
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
|
@ -749,7 +749,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidateHiddenMultipleModel() {
|
||||
public function testValidateHiddenMultipleModel() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
$fields = 'a2d01072dc4660eea9d15007025f35a7a5b58e18%3AModel.valid%7CModel2.valid%7CModel3.valid';
|
||||
|
@ -770,7 +770,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidateHasManyModel() {
|
||||
public function testValidateHasManyModel() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
$fields = '51e3b55a6edd82020b3f29c9ae200e14bbeb7ee5%3AModel.0.hidden%7CModel.0.valid';
|
||||
|
@ -800,7 +800,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidateHasManyRecordsPass() {
|
||||
public function testValidateHasManyRecordsPass() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
$fields = '7a203edb3d345bbf38fe0dccae960da8842e11d7%3AAddress.0.id%7CAddress.0.primary%7C';
|
||||
|
@ -844,7 +844,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidateHasManyRecordsFail() {
|
||||
public function testValidateHasManyRecordsFail() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
$fields = '7a203edb3d345bbf38fe0dccae960da8842e11d7%3AAddress.0.id%7CAddress.0.primary%7C';
|
||||
|
@ -886,7 +886,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFormDisabledFields() {
|
||||
public function testFormDisabledFields() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
$fields = '11842060341b9d0fc3808b90ba29fdea7054d6ad%3An%3A0%3A%7B%7D';
|
||||
|
@ -917,7 +917,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRadio() {
|
||||
public function testRadio() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
$fields = '575ef54ca4fc8cab468d6d898e9acd3a9671c17e%3An%3A0%3A%7B%7D';
|
||||
|
@ -957,7 +957,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @return void
|
||||
* @see http://cakephp.lighthouseapp.com/projects/42648/tickets/68
|
||||
*/
|
||||
function testSettingTokenForRequestAction() {
|
||||
public function testSettingTokenForRequestAction() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
|
||||
|
@ -975,7 +975,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
* @link http://cakephp.lighthouseapp.com/projects/42648/tickets/214
|
||||
* @return void
|
||||
*/
|
||||
function testBlackHoleNotDeletingSessionInformation() {
|
||||
public function testBlackHoleNotDeletingSessionInformation() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
|
||||
$this->Controller->Security->blackHole($this->Controller, 'auth');
|
||||
|
@ -987,7 +987,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCsrfSettings() {
|
||||
public function testCsrfSettings() {
|
||||
$this->Security->validatePost = false;
|
||||
$this->Security->csrfCheck = true;
|
||||
$this->Security->csrfExpires = '+10 minutes';
|
||||
|
@ -1004,7 +1004,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCsrfSettingMultipleNonces() {
|
||||
public function testCsrfSettingMultipleNonces() {
|
||||
$this->Security->validatePost = false;
|
||||
$this->Security->csrfCheck = true;
|
||||
$this->Security->csrfExpires = '+10 minutes';
|
||||
|
@ -1023,7 +1023,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCsrfNonceConsumption() {
|
||||
public function testCsrfNonceConsumption() {
|
||||
$this->Security->validatePost = false;
|
||||
$this->Security->csrfCheck = true;
|
||||
$this->Security->csrfExpires = '+10 minutes';
|
||||
|
@ -1054,7 +1054,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCsrfNonceVacuum() {
|
||||
public function testCsrfNonceVacuum() {
|
||||
$this->Security->validatePost = false;
|
||||
$this->Security->csrfCheck = true;
|
||||
$this->Security->csrfExpires = '+10 minutes';
|
||||
|
@ -1076,7 +1076,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCsrfBlackHoleOnKeyMismatch() {
|
||||
public function testCsrfBlackHoleOnKeyMismatch() {
|
||||
$this->Security->validatePost = false;
|
||||
$this->Security->csrfCheck = true;
|
||||
$this->Security->csrfExpires = '+10 minutes';
|
||||
|
@ -1106,7 +1106,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCsrfBlackHoleOnExpiredKey() {
|
||||
public function testCsrfBlackHoleOnExpiredKey() {
|
||||
$this->Security->validatePost = false;
|
||||
$this->Security->csrfCheck = true;
|
||||
$this->Security->csrfExpires = '+10 minutes';
|
||||
|
@ -1136,7 +1136,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCsrfNotUseOnce() {
|
||||
public function testCsrfNotUseOnce() {
|
||||
$this->Security->validatePost = false;
|
||||
$this->Security->csrfCheck = true;
|
||||
$this->Security->csrfUseOnce = false;
|
||||
|
@ -1158,7 +1158,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCsrfNotUseOnceValidationLeavingToken() {
|
||||
public function testCsrfNotUseOnceValidationLeavingToken() {
|
||||
$this->Security->validatePost = false;
|
||||
$this->Security->csrfCheck = true;
|
||||
$this->Security->csrfUseOnce = false;
|
||||
|
|
|
@ -114,7 +114,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$_SESSION = null;
|
||||
$this->ComponentCollection = new ComponentCollection();
|
||||
|
@ -126,7 +126,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
CakeSession::destroy();
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionIdConsistentAcrossRequestAction() {
|
||||
public function testSessionIdConsistentAcrossRequestAction() {
|
||||
$Session = new SessionComponent($this->ComponentCollection);
|
||||
$Session->check('Test');
|
||||
$this->assertTrue(isset($_SESSION));
|
||||
|
@ -159,7 +159,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionValid() {
|
||||
public function testSessionValid() {
|
||||
$Session = new SessionComponent($this->ComponentCollection);
|
||||
|
||||
$this->assertTrue($Session->valid());
|
||||
|
@ -179,7 +179,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionError() {
|
||||
public function testSessionError() {
|
||||
$Session = new SessionComponent($this->ComponentCollection);
|
||||
$this->assertFalse($Session->error());
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionReadWrite() {
|
||||
public function testSessionReadWrite() {
|
||||
$Session = new SessionComponent($this->ComponentCollection);
|
||||
|
||||
$this->assertNull($Session->read('Test'));
|
||||
|
@ -224,7 +224,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionDelete() {
|
||||
public function testSessionDelete() {
|
||||
$Session = new SessionComponent($this->ComponentCollection);
|
||||
|
||||
$this->assertFalse($Session->delete('Test'));
|
||||
|
@ -239,7 +239,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionCheck() {
|
||||
public function testSessionCheck() {
|
||||
$Session = new SessionComponent($this->ComponentCollection);
|
||||
|
||||
$this->assertFalse($Session->check('Test'));
|
||||
|
@ -255,7 +255,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionFlash() {
|
||||
public function testSessionFlash() {
|
||||
$Session = new SessionComponent($this->ComponentCollection);
|
||||
|
||||
$this->assertNull($Session->read('Message.flash'));
|
||||
|
@ -281,7 +281,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionId() {
|
||||
public function testSessionId() {
|
||||
unset($_SESSION);
|
||||
$Session = new SessionComponent($this->ComponentCollection);
|
||||
$Session->check('test');
|
||||
|
@ -294,7 +294,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionDestroy() {
|
||||
public function testSessionDestroy() {
|
||||
$Session = new SessionComponent($this->ComponentCollection);
|
||||
|
||||
$Session->write('Test', 'some value');
|
||||
|
|
|
@ -33,7 +33,7 @@ class ComponentCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup() {
|
||||
public function setup() {
|
||||
$this->Components = new ComponentCollection();
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ class ComponentCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function teardown() {
|
||||
public function teardown() {
|
||||
unset($this->Components);
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ class ComponentCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoad() {
|
||||
public function testLoad() {
|
||||
$result = $this->Components->load('Cookie');
|
||||
$this->assertInstanceOf('CookieComponent', $result);
|
||||
$this->assertInstanceOf('CookieComponent', $this->Components->Cookie);
|
||||
|
@ -70,7 +70,7 @@ class ComponentCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoadWithAlias() {
|
||||
public function testLoadWithAlias() {
|
||||
$result = $this->Components->load('Cookie', array('className' => 'CookieAlias', 'somesetting' => true));
|
||||
$this->assertInstanceOf('CookieAliasComponent', $result);
|
||||
$this->assertInstanceOf('CookieAliasComponent', $this->Components->Cookie);
|
||||
|
@ -101,7 +101,7 @@ class ComponentCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoadWithEnableFalse() {
|
||||
public function testLoadWithEnableFalse() {
|
||||
$result = $this->Components->load('Cookie', array('enabled' => false));
|
||||
$this->assertInstanceOf('CookieComponent', $result);
|
||||
$this->assertInstanceOf('CookieComponent', $this->Components->Cookie);
|
||||
|
@ -114,7 +114,7 @@ class ComponentCollectionTest extends CakeTestCase {
|
|||
* @expectedException MissingComponentClassException
|
||||
* @return void
|
||||
*/
|
||||
function testLoadMissingComponentFile() {
|
||||
public function testLoadMissingComponentFile() {
|
||||
$this->Components->load('ThisComponentShouldAlwaysBeMissing');
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ class ComponentCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoadPluginComponent() {
|
||||
public function testLoadPluginComponent() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||
));
|
||||
|
@ -140,7 +140,7 @@ class ComponentCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testUnload() {
|
||||
public function testUnload() {
|
||||
$this->Components->load('Cookie');
|
||||
$this->Components->load('Security');
|
||||
|
||||
|
@ -163,7 +163,7 @@ class ComponentCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testGetController() {
|
||||
public function testGetController() {
|
||||
$controller = $this->getMock('Controller');
|
||||
$controller->components = array('Security');
|
||||
$this->Components->init($controller);
|
||||
|
|
|
@ -51,7 +51,7 @@ class ParamTestComponent extends Component {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function initialize(&$controller, $settings) {
|
||||
public function initialize(&$controller, $settings) {
|
||||
foreach ($settings as $key => $value) {
|
||||
if (is_numeric($key)) {
|
||||
$this->{$value} = true;
|
||||
|
@ -117,7 +117,7 @@ class AppleComponent extends Component {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function startup(&$controller) {
|
||||
public function startup(&$controller) {
|
||||
$this->testName = $controller->name;
|
||||
}
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ class OrangeComponent extends Component {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function initialize(&$controller) {
|
||||
public function initialize(&$controller) {
|
||||
$this->Controller = $controller;
|
||||
$this->Banana->testField = 'OrangeField';
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ class ComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
$this->_pluginPaths = App::path('plugins');
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
|
@ -261,7 +261,7 @@ class ComponentTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
App::build();
|
||||
ClassRegistry::flush();
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ class ComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testInnerComponentConstruction() {
|
||||
public function testInnerComponentConstruction() {
|
||||
$Collection = new ComponentCollection();
|
||||
$Component = new AppleComponent($Collection);
|
||||
|
||||
|
@ -283,7 +283,7 @@ class ComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testNestedComponentLoading() {
|
||||
public function testNestedComponentLoading() {
|
||||
$Collection = new ComponentCollection();
|
||||
$Apple = new AppleComponent($Collection);
|
||||
|
||||
|
@ -298,7 +298,7 @@ class ComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testInnerComponentsAreNotEnabled() {
|
||||
public function testInnerComponentsAreNotEnabled() {
|
||||
$Collection = new ComponentCollection();
|
||||
$Apple = $Collection->load('Apple');
|
||||
|
||||
|
@ -312,7 +312,7 @@ class ComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMultipleComponentInitialize() {
|
||||
public function testMultipleComponentInitialize() {
|
||||
$Collection = new ComponentCollection();
|
||||
$Banana = $Collection->load('Banana');
|
||||
$Orange = $Collection->load('Orange');
|
||||
|
@ -328,7 +328,7 @@ class ComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSomethingReferencingEmailComponent() {
|
||||
public function testSomethingReferencingEmailComponent() {
|
||||
$Controller = new ComponentTestController();
|
||||
$Controller->components = array('SomethingWithEmail');
|
||||
$Controller->uses = false;
|
||||
|
|
|
@ -145,7 +145,7 @@ class ControllerMergeVarsTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testComponentParamMergingNoDuplication() {
|
||||
public function testComponentParamMergingNoDuplication() {
|
||||
$Controller = new MergeVariablesController();
|
||||
$Controller->constructClasses();
|
||||
|
||||
|
@ -158,7 +158,7 @@ class ControllerMergeVarsTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testComponentMergingWithRedeclarations() {
|
||||
public function testComponentMergingWithRedeclarations() {
|
||||
$Controller = new MergeVariablesController();
|
||||
$Controller->components['MergeVar'] = array('remote', 'redirect' => true);
|
||||
$Controller->constructClasses();
|
||||
|
@ -172,7 +172,7 @@ class ControllerMergeVarsTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHelperSettingMergingNoDuplication() {
|
||||
public function testHelperSettingMergingNoDuplication() {
|
||||
$Controller = new MergeVariablesController();
|
||||
$Controller->constructClasses();
|
||||
|
||||
|
@ -186,7 +186,7 @@ class ControllerMergeVarsTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHelperOrderPrecedence() {
|
||||
public function testHelperOrderPrecedence() {
|
||||
$Controller = new MergeVariablesController();
|
||||
$Controller->helpers = array('Custom', 'Foo' => array('something'));
|
||||
$Controller->constructClasses();
|
||||
|
@ -204,7 +204,7 @@ class ControllerMergeVarsTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMergeVarsWithPlugin() {
|
||||
public function testMergeVarsWithPlugin() {
|
||||
$Controller = new MergePostsController();
|
||||
$Controller->components = array('Email' => array('ports' => 'open'));
|
||||
$Controller->plugin = 'MergeVarPlugin';
|
||||
|
@ -241,7 +241,7 @@ class ControllerMergeVarsTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMergeVarsNotGreedy() {
|
||||
public function testMergeVarsNotGreedy() {
|
||||
$Controller = new Controller();
|
||||
$Controller->components = array();
|
||||
$Controller->uses = array();
|
||||
|
|
|
@ -99,7 +99,7 @@ class ControllerPost extends CakeTestModel {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeFind($query) {
|
||||
public function beforeFind($query) {
|
||||
$this->lastQuery = $query;
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ class ControllerPost extends CakeTestModel {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function find($type, $options = array()) {
|
||||
public function find($type, $options = array()) {
|
||||
if ($type == 'popular') {
|
||||
$conditions = array($this->name . '.' . $this->primaryKey .' > ' => '1');
|
||||
$options = Set::merge($options, compact('conditions'));
|
||||
|
@ -289,7 +289,7 @@ class TestController extends ControllerTestAppController {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function index($testId, $test2Id) {
|
||||
public function index($testId, $test2Id) {
|
||||
$this->data = array(
|
||||
'testId' => $testId,
|
||||
'test2Id' => $test2Id
|
||||
|
@ -310,7 +310,7 @@ class TestComponent extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeRedirect() {
|
||||
public function beforeRedirect() {
|
||||
}
|
||||
/**
|
||||
* initialize method
|
||||
|
@ -318,7 +318,7 @@ class TestComponent extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function initialize(&$controller) {
|
||||
public function initialize(&$controller) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -327,7 +327,7 @@ class TestComponent extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function startup(&$controller) {
|
||||
public function startup(&$controller) {
|
||||
}
|
||||
/**
|
||||
* shutdown method
|
||||
|
@ -335,14 +335,14 @@ class TestComponent extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function shutdown(&$controller) {
|
||||
public function shutdown(&$controller) {
|
||||
}
|
||||
/**
|
||||
* beforeRender callback
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function beforeRender(&$controller) {
|
||||
public function beforeRender(&$controller) {
|
||||
if ($this->viewclass) {
|
||||
$controller->viewClass = $this->viewclass;
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
App::objects('plugin', null, false);
|
||||
App::build();
|
||||
Router::reload();
|
||||
|
@ -405,7 +405,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function teardown() {
|
||||
public function teardown() {
|
||||
CakePlugin::unload();
|
||||
App::build();
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLoadModel() {
|
||||
public function testLoadModel() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
$Controller = new Controller($request);
|
||||
|
||||
|
@ -437,7 +437,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLoadModelInPlugins() {
|
||||
public function testLoadModelInPlugins() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||
'Controller' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS),
|
||||
|
@ -468,7 +468,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testConstructClasses() {
|
||||
public function testConstructClasses() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
$Controller = new Controller($request);
|
||||
|
||||
|
@ -501,7 +501,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAliasName() {
|
||||
public function testAliasName() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
$Controller = new Controller($request);
|
||||
$Controller->uses = array('NameTest');
|
||||
|
@ -519,7 +519,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPersistent() {
|
||||
public function testPersistent() {
|
||||
$this->markTestIncomplete('persistModel is totally broken right now.');
|
||||
|
||||
Configure::write('Cache.disable', false);
|
||||
|
@ -542,7 +542,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFlash() {
|
||||
public function testFlash() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
$request->webroot = '/';
|
||||
$request->base = '/';
|
||||
|
@ -588,7 +588,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testControllerSet() {
|
||||
public function testControllerSet() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
$Controller = new Controller($request);
|
||||
|
||||
|
@ -632,7 +632,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRender() {
|
||||
public function testRender() {
|
||||
App::build(array(
|
||||
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
|
||||
), true);
|
||||
|
@ -677,7 +677,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testComponentBeforeRenderChangingViewClass() {
|
||||
public function testComponentBeforeRenderChangingViewClass() {
|
||||
App::build(array(
|
||||
'View' => array(
|
||||
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
||||
|
@ -701,7 +701,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testToBeInheritedGuardmethods() {
|
||||
public function testToBeInheritedGuardmethods() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
|
||||
$Controller = new Controller($request);
|
||||
|
@ -735,7 +735,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRedirectByCode($code, $msg) {
|
||||
public function testRedirectByCode($code, $msg) {
|
||||
$Controller = new Controller(null);
|
||||
$Controller->response = $this->getMock('CakeResponse', array('header', 'statusCode'));
|
||||
|
||||
|
@ -756,7 +756,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @dataProvider statusCodeProvider
|
||||
* @return void
|
||||
*/
|
||||
function testRedirectByMessage($code, $msg) {
|
||||
public function testRedirectByMessage($code, $msg) {
|
||||
$Controller = new Controller(null);
|
||||
$Controller->response = $this->getMock('CakeResponse', array('header', 'statusCode'));
|
||||
|
||||
|
@ -777,7 +777,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRedirectTriggeringComponentsReturnNull() {
|
||||
public function testRedirectTriggeringComponentsReturnNull() {
|
||||
$Controller = new Controller(null);
|
||||
$Controller->response = $this->getMock('CakeResponse', array('header', 'statusCode'));
|
||||
$Controller->Components = $this->getMock('ComponentCollection');
|
||||
|
@ -799,7 +799,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRedirectBeforeRedirectModifyingParams() {
|
||||
public function testRedirectBeforeRedirectModifyingParams() {
|
||||
$Controller = new Controller(null);
|
||||
$Controller->response = $this->getMock('CakeResponse', array('header', 'statusCode'));
|
||||
$Controller->Components = $this->getMock('ComponentCollection');
|
||||
|
@ -821,7 +821,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRedirectBeforeRedirectModifyingParamsArrayReturn() {
|
||||
public function testRedirectBeforeRedirectModifyingParamsArrayReturn() {
|
||||
$Controller = $this->getMock('Controller', array('header', '_stop'));
|
||||
$Controller->response = $this->getMock('CakeResponse');
|
||||
$Controller->Components = $this->getMock('ComponentCollection');
|
||||
|
@ -854,7 +854,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRedirectBeforeRedirectInController() {
|
||||
public function testRedirectBeforeRedirectInController() {
|
||||
$Controller = $this->getMock('Controller', array('_stop', 'beforeRedirect'));
|
||||
$Controller->response = $this->getMock('CakeResponse', array('header'));
|
||||
$Controller->Components = $this->getMock('ComponentCollection');
|
||||
|
@ -872,7 +872,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMergeVars() {
|
||||
public function testMergeVars() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
|
||||
$TestController = new TestController($request);
|
||||
|
@ -934,7 +934,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testChildComponentOptionsSupercedeParents() {
|
||||
public function testChildComponentOptionsSupercedeParents() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
|
||||
$TestController = new TestController($request);
|
||||
|
@ -951,7 +951,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMergeVarsNotGreedy() {
|
||||
public function testMergeVarsNotGreedy() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
|
||||
$Controller = new Controller($request);
|
||||
|
@ -968,7 +968,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReferer() {
|
||||
public function testReferer() {
|
||||
$request = $this->getMock('CakeRequest');
|
||||
|
||||
$request->expects($this->any())->method('referer')
|
||||
|
@ -1005,7 +1005,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSetAction() {
|
||||
public function testSetAction() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
|
||||
$TestController = new TestController($request);
|
||||
|
@ -1020,7 +1020,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidateErrors() {
|
||||
public function testValidateErrors() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
|
||||
$TestController = new TestController($request);
|
||||
|
@ -1044,7 +1044,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testValidateErrorsOnArbitraryModels() {
|
||||
public function testValidateErrorsOnArbitraryModels() {
|
||||
$TestController = new TestController();
|
||||
|
||||
$Post = new ControllerPost();
|
||||
|
@ -1062,7 +1062,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPostConditions() {
|
||||
public function testPostConditions() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
|
||||
$Controller = new Controller($request);
|
||||
|
@ -1128,7 +1128,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequestHandlerPrefers(){
|
||||
public function testRequestHandlerPrefers(){
|
||||
Configure::write('debug', 2);
|
||||
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
|
@ -1153,7 +1153,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testControllerHttpCodes() {
|
||||
public function testControllerHttpCodes() {
|
||||
$Controller = new Controller(null);
|
||||
$Controller->response = $this->getMock('CakeResponse', array('httpCodes'));
|
||||
$Controller->response->expects($this->at(0))->method('httpCodes')->with(null);
|
||||
|
@ -1168,7 +1168,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testStartupProcess() {
|
||||
public function testStartupProcess() {
|
||||
$Controller = $this->getMock('Controller', array('beforeFilter', 'afterFilter'));
|
||||
|
||||
$Controller->components = array('MockStartup');
|
||||
|
@ -1189,7 +1189,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testShutdownProcess() {
|
||||
public function testShutdownProcess() {
|
||||
$Controller = $this->getMock('Controller', array('beforeFilter', 'afterFilter'));
|
||||
|
||||
$Controller->components = array('MockShutdown');
|
||||
|
@ -1207,7 +1207,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPropertyBackwardsCompatibility() {
|
||||
public function testPropertyBackwardsCompatibility() {
|
||||
$request = new CakeRequest('posts/index', null);
|
||||
$request->addParams(array('controller' => 'posts', 'action' => 'index'));
|
||||
$request->data = array('Post' => array('id' => 1));
|
||||
|
@ -1234,7 +1234,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPropertyCompatibilityAndModelsComponents() {
|
||||
public function testPropertyCompatibilityAndModelsComponents() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
|
||||
$Controller = new TestController($request);
|
||||
|
@ -1248,7 +1248,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPaginateBackwardsCompatibility() {
|
||||
public function testPaginateBackwardsCompatibility() {
|
||||
$request = new CakeRequest('controller_posts/index');
|
||||
$request->params['pass'] = $request->params['named'] = array();
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class PagesControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function endTest() {
|
||||
public function endTest() {
|
||||
App::build();
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ class PagesControllerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDisplay() {
|
||||
public function testDisplay() {
|
||||
App::build(array(
|
||||
'View' => array(
|
||||
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
||||
|
|
|
@ -246,7 +246,7 @@ class TestScaffoldView extends ScaffoldView {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGetFilename($action) {
|
||||
public function testGetFilename($action) {
|
||||
return $this->_getViewFileName($action);
|
||||
}
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->request = new CakeRequest(null, false);
|
||||
$this->Controller = new ScaffoldMockController($this->request);
|
||||
|
@ -290,7 +290,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
unset($this->Controller, $this->request);
|
||||
CakePlugin::unload();
|
||||
|
@ -302,7 +302,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGetViewFilename() {
|
||||
public function testGetViewFilename() {
|
||||
$_admin = Configure::read('Routing.prefixes');
|
||||
Configure::write('Routing.prefixes', array('admin'));
|
||||
|
||||
|
@ -387,7 +387,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testGetViewFileNameWithTheme() {
|
||||
public function testGetViewFileNameWithTheme() {
|
||||
$this->Controller->request['action'] = 'index';
|
||||
$this->Controller->viewPath = 'Posts';
|
||||
$this->Controller->theme = 'TestTheme';
|
||||
|
@ -405,7 +405,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testIndexScaffold() {
|
||||
public function testIndexScaffold() {
|
||||
$params = array(
|
||||
'plugin' => null,
|
||||
'pass' => array(),
|
||||
|
@ -444,7 +444,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testViewScaffold() {
|
||||
public function testViewScaffold() {
|
||||
$this->Controller->request->base = '';
|
||||
$this->Controller->request->here = '/scaffold_mock';
|
||||
$this->Controller->request->webroot = '/';
|
||||
|
@ -486,7 +486,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testEditScaffold() {
|
||||
public function testEditScaffold() {
|
||||
$this->Controller->request->base = '';
|
||||
$this->Controller->request->webroot = '/';
|
||||
$this->Controller->request->here = '/scaffold_mock/edit/1';
|
||||
|
@ -527,7 +527,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAdminIndexScaffold() {
|
||||
public function testAdminIndexScaffold() {
|
||||
$_backAdmin = Configure::read('Routing.prefixes');
|
||||
|
||||
Configure::write('Routing.prefixes', array('admin'));
|
||||
|
@ -572,7 +572,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAdminEditScaffold() {
|
||||
public function testAdminEditScaffold() {
|
||||
Configure::write('Routing.prefixes', array('admin'));
|
||||
$params = array(
|
||||
'plugin' => null,
|
||||
|
@ -611,7 +611,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultiplePrefixScaffold() {
|
||||
public function testMultiplePrefixScaffold() {
|
||||
$_backAdmin = Configure::read('Routing.prefixes');
|
||||
|
||||
Configure::write('Routing.prefixes', array('admin', 'member'));
|
||||
|
@ -679,7 +679,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$request = new CakeRequest(null, false);
|
||||
$this->Controller = new ScaffoldMockController($request);
|
||||
|
@ -691,7 +691,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
unset($this->Controller);
|
||||
}
|
||||
|
@ -703,7 +703,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testScaffoldParams() {
|
||||
public function testScaffoldParams() {
|
||||
$params = array(
|
||||
'plugin' => null,
|
||||
'pass' => array(),
|
||||
|
@ -733,7 +733,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testScaffoldVariableSetting() {
|
||||
public function testScaffoldVariableSetting() {
|
||||
$params = array(
|
||||
'plugin' => null,
|
||||
'pass' => array(),
|
||||
|
@ -772,7 +772,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testScaffoldChangingViewProperty() {
|
||||
public function testScaffoldChangingViewProperty() {
|
||||
$this->Controller->action = 'edit';
|
||||
$this->Controller->theme = 'TestTheme';
|
||||
$this->Controller->viewClass = 'Theme';
|
||||
|
@ -787,7 +787,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testScaffoldFlashMessages() {
|
||||
public function testScaffoldFlashMessages() {
|
||||
$params = array(
|
||||
'plugin' => null,
|
||||
'pass' => array(1),
|
||||
|
@ -825,7 +825,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHabtmFieldAdditionWithScaffoldForm() {
|
||||
public function testHabtmFieldAdditionWithScaffoldForm() {
|
||||
$params = array(
|
||||
'plugin' => null,
|
||||
'pass' => array(1),
|
||||
|
@ -858,7 +858,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testEditScaffoldWithScaffoldFields() {
|
||||
public function testEditScaffoldWithScaffoldFields() {
|
||||
$request = new CakeRequest(null, false);
|
||||
$this->Controller = new ScaffoldMockControllerWithFields($request);
|
||||
$this->Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
|
||||
|
|
|
@ -22,7 +22,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBuild() {
|
||||
public function testBuild() {
|
||||
$old = App::path('Model');
|
||||
$expected = array(
|
||||
APP . 'Model' . DS,
|
||||
|
@ -90,7 +90,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCompatibleBuild() {
|
||||
public function testCompatibleBuild() {
|
||||
$old = App::path('models');
|
||||
$expected = array(
|
||||
APP . 'Model' . DS,
|
||||
|
@ -191,7 +191,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBuildWithReset() {
|
||||
public function testBuildWithReset() {
|
||||
$old = App::path('Model');
|
||||
$expected = array(
|
||||
APP . 'Model' . DS,
|
||||
|
@ -219,7 +219,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCore() {
|
||||
public function testCore() {
|
||||
$model = App::core('Model');
|
||||
$this->assertEqual(array(CAKE . 'Model' . DS), $model);
|
||||
|
||||
|
@ -245,7 +245,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testListObjects() {
|
||||
public function testListObjects() {
|
||||
$result = App::objects('class', CAKE . 'Routing', false);
|
||||
$this->assertTrue(in_array('Dispatcher', $result));
|
||||
$this->assertTrue(in_array('Router', $result));
|
||||
|
@ -315,7 +315,7 @@ class AppTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testListObjectsInPlugin() {
|
||||
public function testListObjectsInPlugin() {
|
||||
App::build(array(
|
||||
'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
|
@ -365,7 +365,7 @@ class AppTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPluginPath() {
|
||||
public function testPluginPath() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
));
|
||||
|
@ -386,7 +386,7 @@ class AppTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testThemePath() {
|
||||
public function testThemePath() {
|
||||
App::build(array(
|
||||
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
|
||||
));
|
||||
|
@ -407,7 +407,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testClassLoading() {
|
||||
public function testClassLoading() {
|
||||
$file = App::import('Model', 'Model', false);
|
||||
$this->assertTrue($file);
|
||||
$this->assertTrue(class_exists('Model'));
|
||||
|
@ -486,7 +486,7 @@ class AppTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPluginImporting() {
|
||||
public function testPluginImporting() {
|
||||
App::build(array(
|
||||
'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
|
@ -527,7 +527,7 @@ class AppTest extends CakeTestCase {
|
|||
* @return void
|
||||
* @link http://cakephp.lighthouseapp.com/projects/42648/tickets/410
|
||||
*/
|
||||
function testImportingHelpersFromAlternatePaths() {
|
||||
public function testImportingHelpersFromAlternatePaths() {
|
||||
|
||||
$this->assertFalse(class_exists('BananaHelper', false), 'BananaHelper exists, cannot test importing it.');
|
||||
App::build(array(
|
||||
|
@ -548,7 +548,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFileLoading () {
|
||||
public function testFileLoading () {
|
||||
$file = App::import('File', 'RealFile', false, array(), CAKE . 'Config' . DS . 'config.php');
|
||||
$this->assertTrue($file);
|
||||
|
||||
|
@ -562,7 +562,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFileLoadingWithArray() {
|
||||
public function testFileLoadingWithArray() {
|
||||
$type = array('type' => 'File', 'name' => 'SomeName', 'parent' => false,
|
||||
'file' => CAKE . DS . 'Config' . DS . 'config.php');
|
||||
$file = App::import($type);
|
||||
|
@ -580,7 +580,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFileLoadingReturnValue () {
|
||||
public function testFileLoadingReturnValue () {
|
||||
$file = App::import('File', 'Name', false, array(), CAKE . 'Config' . DS . 'config.php', true);
|
||||
$this->assertTrue(!empty($file));
|
||||
|
||||
|
@ -600,7 +600,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLoadingWithSearch () {
|
||||
public function testLoadingWithSearch () {
|
||||
$file = App::import('File', 'NewName', false, array(CAKE . 'Config' . DS), 'config.php');
|
||||
$this->assertTrue($file);
|
||||
|
||||
|
@ -614,7 +614,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLoadingWithSearchArray() {
|
||||
public function testLoadingWithSearchArray() {
|
||||
$type = array(
|
||||
'type' => 'File',
|
||||
'name' => 'RandomName',
|
||||
|
@ -642,7 +642,7 @@ class AppTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultipleLoading() {
|
||||
public function testMultipleLoading() {
|
||||
if (class_exists('PersisterOne', false) || class_exists('PersisterTwo', false)) {
|
||||
$this->markTestSkipped('Cannot test loading of classes that exist.');
|
||||
}
|
||||
|
@ -664,7 +664,7 @@ class AppTest extends CakeTestCase {
|
|||
}
|
||||
|
||||
|
||||
function testLoadingVendor() {
|
||||
public function testLoadingVendor() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||
'vendors' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor'. DS),
|
||||
|
|
|
@ -33,7 +33,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
$this->_cacheDisable = Configure::read('Cache.disable');
|
||||
$this->_debug = Configure::read('debug');
|
||||
|
||||
|
@ -48,7 +48,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
if (file_exists(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_core_paths')) {
|
||||
unlink(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_core_paths');
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRead() {
|
||||
public function testRead() {
|
||||
$expected = 'ok';
|
||||
Configure::write('level1.level2.level3_1', $expected);
|
||||
Configure::write('level1.level2.level3_2', 'something_else');
|
||||
|
@ -106,7 +106,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testWrite() {
|
||||
public function testWrite() {
|
||||
$writeResult = Configure::write('SomeName.someKey', 'myvalue');
|
||||
$this->assertTrue($writeResult);
|
||||
$result = Configure::read('SomeName.someKey');
|
||||
|
@ -143,7 +143,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDebugSettingDisplayErrors() {
|
||||
public function testDebugSettingDisplayErrors() {
|
||||
Configure::write('debug', 0);
|
||||
$result = ini_get('display_errors');
|
||||
$this->assertEqual($result, 0);
|
||||
|
@ -159,7 +159,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDelete() {
|
||||
public function testDelete() {
|
||||
Configure::write('SomeName.someKey', 'myvalue');
|
||||
$result = Configure::read('SomeName.someKey');
|
||||
$this->assertEqual($result, 'myvalue');
|
||||
|
@ -191,7 +191,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* @expectedException RuntimeException
|
||||
* @return void
|
||||
*/
|
||||
function testLoadExceptionOnNonExistantFile() {
|
||||
public function testLoadExceptionOnNonExistantFile() {
|
||||
Configure::config('test', new PhpReader());
|
||||
$result = Configure::load('non_existing_configuration_file', 'test');
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoadWithMerge() {
|
||||
public function testLoadWithMerge() {
|
||||
Configure::config('test', new PhpReader(CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS));
|
||||
|
||||
$result = Configure::load('var_test', 'test');
|
||||
|
@ -222,7 +222,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoadNoMerge() {
|
||||
public function testLoadNoMerge() {
|
||||
Configure::config('test', new PhpReader(CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS));
|
||||
|
||||
$result = Configure::load('var_test', 'test');
|
||||
|
@ -244,7 +244,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLoadPlugin() {
|
||||
public function testLoadPlugin() {
|
||||
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)), true);
|
||||
Configure::config('test', new PhpReader());
|
||||
CakePlugin::load('TestPlugin');
|
||||
|
@ -268,7 +268,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testStoreAndRestore() {
|
||||
public function testStoreAndRestore() {
|
||||
Configure::write('Cache.disable', false);
|
||||
|
||||
Configure::write('Testing', 'yummy');
|
||||
|
@ -288,7 +288,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testStoreAndRestoreWithData() {
|
||||
public function testStoreAndRestoreWithData() {
|
||||
Configure::write('Cache.disable', false);
|
||||
|
||||
Configure::write('testing', 'value');
|
||||
|
@ -309,7 +309,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testVersion() {
|
||||
public function testVersion() {
|
||||
$result = Configure::version();
|
||||
$this->assertTrue(version_compare($result, '1.2', '>='));
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testReaderSetup() {
|
||||
public function testReaderSetup() {
|
||||
$reader = new PhpReader();
|
||||
Configure::config('test', $reader);
|
||||
$configured = Configure::configured();
|
||||
|
@ -339,7 +339,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* @expectedException Exception
|
||||
* @return void
|
||||
*/
|
||||
function testReaderExceptionOnIncorrectClass() {
|
||||
public function testReaderExceptionOnIncorrectClass() {
|
||||
$reader = new StdClass();
|
||||
Configure::config('test', $reader);
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ class RequestActionController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function test_request_action() {
|
||||
public function test_request_action() {
|
||||
return 'This is a test';
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ class RequestActionController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function another_ra_test($id, $other) {
|
||||
public function another_ra_test($id, $other) {
|
||||
return $id + $other;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ class RequestActionController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function normal_request_action() {
|
||||
public function normal_request_action() {
|
||||
return 'Hello World';
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ class RequestActionController extends Controller {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function return_here() {
|
||||
public function return_here() {
|
||||
return $this->here;
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ class RequestActionController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function paginate_request_action() {
|
||||
public function paginate_request_action() {
|
||||
$data = $this->paginate();
|
||||
return true;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ class RequestActionController extends Controller {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
function post_pass() {
|
||||
public function post_pass() {
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ class RequestActionController extends Controller {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
function params_pass() {
|
||||
public function params_pass() {
|
||||
return $this->params;
|
||||
}
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ class RequestActionPersistentController extends Controller {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
function index() {
|
||||
public function index() {
|
||||
return 'This is a test';
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ class TestObject extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function emptyMethod() {
|
||||
public function emptyMethod() {
|
||||
$this->methodCalls[] = 'emptyMethod';
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ class TestObject extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function oneParamMethod($param) {
|
||||
public function oneParamMethod($param) {
|
||||
$this->methodCalls[] = array('oneParamMethod' => array($param));
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ class TestObject extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function twoParamMethod($param, $param2) {
|
||||
public function twoParamMethod($param, $param2) {
|
||||
$this->methodCalls[] = array('twoParamMethod' => array($param, $param2));
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ class TestObject extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function threeParamMethod($param, $param2, $param3) {
|
||||
public function threeParamMethod($param, $param2, $param3) {
|
||||
$this->methodCalls[] = array('threeParamMethod' => array($param, $param2, $param3));
|
||||
}
|
||||
/**
|
||||
|
@ -251,7 +251,7 @@ class TestObject extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function fourParamMethod($param, $param2, $param3, $param4) {
|
||||
public function fourParamMethod($param, $param2, $param3, $param4) {
|
||||
$this->methodCalls[] = array('fourParamMethod' => array($param, $param2, $param3, $param4));
|
||||
}
|
||||
/**
|
||||
|
@ -265,7 +265,7 @@ class TestObject extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function fiveParamMethod($param, $param2, $param3, $param4, $param5) {
|
||||
public function fiveParamMethod($param, $param2, $param3, $param4, $param5) {
|
||||
$this->methodCalls[] = array('fiveParamMethod' => array($param, $param2, $param3, $param4, $param5));
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,7 @@ class TestObject extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function crazyMethod($param, $param2, $param3, $param4, $param5, $param6, $param7 = null) {
|
||||
public function crazyMethod($param, $param2, $param3, $param4, $param5, $param6, $param7 = null) {
|
||||
$this->methodCalls[] = array('crazyMethod' => array($param, $param2, $param3, $param4, $param5, $param6, $param7));
|
||||
}
|
||||
|
||||
|
@ -293,7 +293,7 @@ class TestObject extends Object {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function methodWithOptionalParam($param = null) {
|
||||
public function methodWithOptionalParam($param = null) {
|
||||
$this->methodCalls[] = array('methodWithOptionalParam' => array($param));
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ class TestObject extends Object {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPersist($name, $return = null, &$object, $type = null) {
|
||||
public function testPersist($name, $return = null, &$object, $type = null) {
|
||||
return $this->_persist($name, $return, $object, $type);
|
||||
}
|
||||
/**
|
||||
|
@ -345,7 +345,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
$this->object = new TestObject();
|
||||
}
|
||||
|
||||
|
@ -355,7 +355,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
App::build();
|
||||
CakePlugin::unload();
|
||||
unset($this->object);
|
||||
|
@ -367,7 +367,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLog() {
|
||||
public function testLog() {
|
||||
if (file_exists(LOGS . 'error.log')) {
|
||||
unlink(LOGS . 'error.log');
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSet() {
|
||||
public function testSet() {
|
||||
$this->object->set('a string');
|
||||
$this->assertEqual($this->object->firstName, 'Joel');
|
||||
|
||||
|
@ -419,7 +419,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPersist() {
|
||||
public function testPersist() {
|
||||
$this->markTestIncomplete('Object::persist() is totally broken right now.');
|
||||
|
||||
ClassRegistry::flush();
|
||||
|
@ -464,7 +464,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPersistWithBehavior() {
|
||||
public function testPersistWithBehavior() {
|
||||
$this->markTestIncomplete('Object::persist() is totally broken right now.');
|
||||
ClassRegistry::flush();
|
||||
|
||||
|
@ -522,7 +522,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPersistWithBehaviorAndRequestAction() {
|
||||
public function testPersistWithBehaviorAndRequestAction() {
|
||||
$this->markTestIncomplete('Object::persist() is totally broken right now.');
|
||||
|
||||
ClassRegistry::flush();
|
||||
|
@ -597,7 +597,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testToString() {
|
||||
public function testToString() {
|
||||
$result = strtolower($this->object->toString());
|
||||
$this->assertEqual($result, 'testobject');
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMethodDispatching() {
|
||||
public function testMethodDispatching() {
|
||||
$this->object->emptyMethod();
|
||||
$expected = array('emptyMethod');
|
||||
$this->assertIdentical($this->object->methodCalls, $expected);
|
||||
|
@ -675,7 +675,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequestAction() {
|
||||
public function testRequestAction() {
|
||||
App::build(array(
|
||||
'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
||||
'views' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
||||
|
@ -713,7 +713,7 @@ class ObjectTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRequestActionPlugins() {
|
||||
public function testRequestActionPlugins() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||
), true);
|
||||
|
@ -750,7 +750,7 @@ class ObjectTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRequestActionArray() {
|
||||
public function testRequestActionArray() {
|
||||
App::build(array(
|
||||
'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
||||
'views' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
||||
|
@ -806,7 +806,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequestActionParamParseAndPass() {
|
||||
public function testRequestActionParamParseAndPass() {
|
||||
$result = $this->object->requestAction('/request_action/params_pass');
|
||||
$this->assertEqual($result->url, 'request_action/params_pass');
|
||||
$this->assertEqual($result['controller'], 'request_action');
|
||||
|
@ -830,7 +830,7 @@ class ObjectTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRequestActionPostPassing() {
|
||||
public function testRequestActionPostPassing() {
|
||||
$_tmp = $_POST;
|
||||
|
||||
$_POST = array('data' => array(
|
||||
|
@ -859,7 +859,7 @@ class ObjectTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCakeError() {
|
||||
public function testCakeError() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
App::build(array(
|
||||
'View' => array(
|
||||
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
||||
|
@ -55,7 +55,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function teardown() {
|
||||
public function teardown() {
|
||||
Configure::write('debug', $this->_debug);
|
||||
Configure::write('Error', $this->_error);
|
||||
App::build();
|
||||
|
@ -69,7 +69,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHandleErrorDebugOn() {
|
||||
public function testHandleErrorDebugOn() {
|
||||
set_error_handler('ErrorHandler::handleError');
|
||||
$this->_restoreError = true;
|
||||
|
||||
|
@ -101,7 +101,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
* @dataProvider errorProvider
|
||||
* @return void
|
||||
*/
|
||||
function testErrorMapping($error, $expected) {
|
||||
public function testErrorMapping($error, $expected) {
|
||||
set_error_handler('ErrorHandler::handleError');
|
||||
$this->_restoreError = true;
|
||||
|
||||
|
@ -117,7 +117,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testErrorSuppressed() {
|
||||
public function testErrorSuppressed() {
|
||||
set_error_handler('ErrorHandler::handleError');
|
||||
$this->_restoreError = true;
|
||||
|
||||
|
@ -132,7 +132,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHandleErrorDebugOff() {
|
||||
public function testHandleErrorDebugOff() {
|
||||
Configure::write('debug', 0);
|
||||
Configure::write('Error.trace', false);
|
||||
if (file_exists(LOGS . 'debug.log')) {
|
||||
|
@ -158,7 +158,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHandleErrorLoggingTrace() {
|
||||
public function testHandleErrorLoggingTrace() {
|
||||
Configure::write('debug', 0);
|
||||
Configure::write('Error.trace', true);
|
||||
if (file_exists(LOGS . 'debug.log')) {
|
||||
|
@ -185,7 +185,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHandleException() {
|
||||
public function testHandleException() {
|
||||
if ($this->skipIf(file_exists(APP . 'app_error.php'), 'App error exists cannot run.')) {
|
||||
return;
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHandleExceptionLog() {
|
||||
public function testHandleExceptionLog() {
|
||||
if ($this->skipIf(file_exists(APP . 'app_error.php'), 'App error exists cannot run.')) {
|
||||
return;
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLoadPluginHanlder() {
|
||||
public function testLoadPluginHanlder() {
|
||||
App::build(array(
|
||||
'plugins' => array(
|
||||
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
|
||||
|
|
|
@ -68,7 +68,7 @@ class BlueberryComponent extends Component {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function initialize(&$controller) {
|
||||
public function initialize(&$controller) {
|
||||
$this->testName = 'BlueberryComponent';
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ class TestErrorController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeRender() {
|
||||
public function beforeRender() {
|
||||
echo $this->Blueberry->testName;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ class TestErrorController extends Controller {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function index() {
|
||||
public function index() {
|
||||
$this->autoRender = false;
|
||||
return 'what up';
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ class MyCustomExceptionRenderer extends ExceptionRenderer {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function missingWidgetThing() {
|
||||
public function missingWidgetThing() {
|
||||
echo 'widget thing is missing';
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
App::build(array(
|
||||
'views' => array(
|
||||
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
|
||||
|
@ -176,7 +176,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function teardown() {
|
||||
public function teardown() {
|
||||
Configure::write('debug', $this->_debug);
|
||||
Configure::write('Error', $this->_error);
|
||||
App::build();
|
||||
|
@ -201,7 +201,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSubclassMethodsNotBeingConvertedToError() {
|
||||
public function testSubclassMethodsNotBeingConvertedToError() {
|
||||
Configure::write('debug', 2);
|
||||
|
||||
$exception = new MissingWidgetThingException('Widget not found');
|
||||
|
@ -219,7 +219,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSubclassMethodsNotBeingConvertedDebug0() {
|
||||
public function testSubclassMethodsNotBeingConvertedDebug0() {
|
||||
Configure::write('debug', 0);
|
||||
$exception = new MissingWidgetThingException('Widget not found');
|
||||
$ExceptionRenderer = $this->_mockResponse(new MyCustomExceptionRenderer($exception));
|
||||
|
@ -238,7 +238,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSubclassConvertingFrameworkErrors() {
|
||||
public function testSubclassConvertingFrameworkErrors() {
|
||||
Configure::write('debug', 0);
|
||||
|
||||
$exception = new MissingControllerException('PostsController');
|
||||
|
@ -258,7 +258,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConstruction() {
|
||||
public function testConstruction() {
|
||||
$exception = new NotFoundException('Page not found');
|
||||
$ExceptionRenderer = new ExceptionRenderer($exception);
|
||||
|
||||
|
@ -272,7 +272,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testErrorMethodCoercion() {
|
||||
public function testErrorMethodCoercion() {
|
||||
Configure::write('debug', 0);
|
||||
$exception = new MissingActionException('Page not found');
|
||||
$ExceptionRenderer = new ExceptionRenderer($exception);
|
||||
|
@ -287,7 +287,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testUnknownExceptionTypeWithExceptionThatHasA400Code() {
|
||||
public function testUnknownExceptionTypeWithExceptionThatHasA400Code() {
|
||||
$exception = new MissingWidgetThingException('coding fail.');
|
||||
$ExceptionRenderer = new ExceptionRenderer($exception);
|
||||
$ExceptionRenderer->controller->response = $this->getMock('CakeResponse', array('statusCode', '_sendHeader'));
|
||||
|
@ -306,7 +306,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testUnknownExceptionTypeWithNoCodeIsA500() {
|
||||
public function testUnknownExceptionTypeWithNoCodeIsA500() {
|
||||
$exception = new OutOfBoundsException('foul ball.');
|
||||
$ExceptionRenderer = new ExceptionRenderer($exception);
|
||||
$ExceptionRenderer->controller->response = $this->getMock('CakeResponse', array('statusCode', '_sendHeader'));
|
||||
|
@ -324,7 +324,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testUnknownExceptionTypeWithCodeHigherThan500() {
|
||||
public function testUnknownExceptionTypeWithCodeHigherThan500() {
|
||||
$exception = new OutOfBoundsException('foul ball.', 501);
|
||||
$ExceptionRenderer = new ExceptionRenderer($exception);
|
||||
$ExceptionRenderer->controller->response = $this->getMock('CakeResponse', array('statusCode', '_sendHeader'));
|
||||
|
@ -343,7 +343,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testError400() {
|
||||
public function testError400() {
|
||||
Router::reload();
|
||||
|
||||
$request = new CakeRequest('posts/view/1000', false);
|
||||
|
@ -367,7 +367,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testerror400OnlyChangingCakeException() {
|
||||
public function testerror400OnlyChangingCakeException() {
|
||||
Configure::write('debug', 0);
|
||||
|
||||
$exception = new NotFoundException('Custom message');
|
||||
|
@ -391,7 +391,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testError400NoInjection() {
|
||||
public function testError400NoInjection() {
|
||||
Router::reload();
|
||||
|
||||
$request = new CakeRequest('pages/<span id=333>pink</span></id><script>document.body.style.background = t=document.getElementById(333).innerHTML;window.alert(t);</script>', false);
|
||||
|
@ -414,7 +414,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testError500Message() {
|
||||
public function testError500Message() {
|
||||
$exception = new InternalErrorException('An Internal Error Has Occurred');
|
||||
$ExceptionRenderer = new ExceptionRenderer($exception);
|
||||
$ExceptionRenderer->controller->response = $this->getMock('CakeResponse', array('statusCode', '_sendHeader'));
|
||||
|
@ -433,7 +433,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMissingController() {
|
||||
public function testMissingController() {
|
||||
$exception = new MissingControllerException(array('controller' => 'PostsController'));
|
||||
$ExceptionRenderer = $this->_mockResponse(new ExceptionRenderer($exception));
|
||||
|
||||
|
@ -593,7 +593,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
* @dataProvider testProvider
|
||||
* @return void
|
||||
*/
|
||||
function testCakeExceptionHandling($exception, $patterns, $code) {
|
||||
public function testCakeExceptionHandling($exception, $patterns, $code) {
|
||||
$ExceptionRenderer = new ExceptionRenderer($exception);
|
||||
$ExceptionRenderer->controller->response = $this->getMock('CakeResponse', array('statusCode', '_sendHeader'));
|
||||
$ExceptionRenderer->controller->response->expects($this->once())
|
||||
|
@ -614,7 +614,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testMissingRenderSafe() {
|
||||
public function testMissingRenderSafe() {
|
||||
$exception = new MissingHelperFileException(array('class' => 'Fail'));
|
||||
$ExceptionRenderer = new ExceptionRenderer($exception);
|
||||
|
||||
|
@ -643,7 +643,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRenderWithNoRequest() {
|
||||
public function testRenderWithNoRequest() {
|
||||
Router::reload();
|
||||
$this->assertNull(Router::getRequest(false));
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
Cache::delete('object_map', '_cake_core_');
|
||||
App::build(array(
|
||||
'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS),
|
||||
|
@ -46,14 +46,14 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
Cache::delete('object_map', '_cake_core_');
|
||||
App::build();
|
||||
CakePlugin::unload();
|
||||
}
|
||||
|
||||
|
||||
function testTranslationCaching() {
|
||||
public function testTranslationCaching() {
|
||||
Configure::write('Config.language', 'cache_test_po');
|
||||
$i18n = i18n::getInstance();
|
||||
|
||||
|
@ -102,7 +102,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDefaultStrings() {
|
||||
public function testDefaultStrings() {
|
||||
$singular = $this->__singular();
|
||||
$this->assertEqual('Plural Rule 1', $singular);
|
||||
|
||||
|
@ -172,7 +172,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesZero() {
|
||||
public function testPoRulesZero() {
|
||||
Configure::write('Config.language', 'rule_0_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -244,7 +244,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesZero() {
|
||||
public function testMoRulesZero() {
|
||||
Configure::write('Config.language', 'rule_0_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -316,7 +316,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesOne() {
|
||||
public function testPoRulesOne() {
|
||||
Configure::write('Config.language', 'rule_1_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -388,7 +388,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesOne() {
|
||||
public function testMoRulesOne() {
|
||||
Configure::write('Config.language', 'rule_1_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -460,7 +460,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesTwo() {
|
||||
public function testPoRulesTwo() {
|
||||
Configure::write('Config.language', 'rule_2_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -532,7 +532,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesTwo() {
|
||||
public function testMoRulesTwo() {
|
||||
Configure::write('Config.language', 'rule_2_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -604,7 +604,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesThree() {
|
||||
public function testPoRulesThree() {
|
||||
Configure::write('Config.language', 'rule_3_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -676,7 +676,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesThree() {
|
||||
public function testMoRulesThree() {
|
||||
Configure::write('Config.language', 'rule_3_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -748,7 +748,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesFour() {
|
||||
public function testPoRulesFour() {
|
||||
Configure::write('Config.language', 'rule_4_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -820,7 +820,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesFour() {
|
||||
public function testMoRulesFour() {
|
||||
Configure::write('Config.language', 'rule_4_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -892,7 +892,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesFive() {
|
||||
public function testPoRulesFive() {
|
||||
Configure::write('Config.language', 'rule_5_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -966,7 +966,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesFive() {
|
||||
public function testMoRulesFive() {
|
||||
Configure::write('Config.language', 'rule_5_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1040,7 +1040,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesSix() {
|
||||
public function testPoRulesSix() {
|
||||
Configure::write('Config.language', 'rule_6_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1112,7 +1112,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesSix() {
|
||||
public function testMoRulesSix() {
|
||||
Configure::write('Config.language', 'rule_6_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1184,7 +1184,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesSeven() {
|
||||
public function testPoRulesSeven() {
|
||||
Configure::write('Config.language', 'rule_7_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1256,7 +1256,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesSeven() {
|
||||
public function testMoRulesSeven() {
|
||||
Configure::write('Config.language', 'rule_7_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1328,7 +1328,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesEight() {
|
||||
public function testPoRulesEight() {
|
||||
Configure::write('Config.language', 'rule_8_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1400,7 +1400,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesEight() {
|
||||
public function testMoRulesEight() {
|
||||
Configure::write('Config.language', 'rule_8_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1472,7 +1472,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesNine() {
|
||||
public function testPoRulesNine() {
|
||||
Configure::write('Config.language', 'rule_9_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1547,7 +1547,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesNine() {
|
||||
public function testMoRulesNine() {
|
||||
Configure::write('Config.language', 'rule_9_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1622,7 +1622,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesTen() {
|
||||
public function testPoRulesTen() {
|
||||
Configure::write('Config.language', 'rule_10_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1696,7 +1696,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesTen() {
|
||||
public function testMoRulesTen() {
|
||||
Configure::write('Config.language', 'rule_10_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1770,7 +1770,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesEleven() {
|
||||
public function testPoRulesEleven() {
|
||||
Configure::write('Config.language', 'rule_11_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1842,7 +1842,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesEleven() {
|
||||
public function testMoRulesEleven() {
|
||||
Configure::write('Config.language', 'rule_11_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1914,7 +1914,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesTwelve() {
|
||||
public function testPoRulesTwelve() {
|
||||
Configure::write('Config.language', 'rule_12_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -1986,7 +1986,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesTwelve() {
|
||||
public function testMoRulesTwelve() {
|
||||
Configure::write('Config.language', 'rule_12_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -2058,7 +2058,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesThirteen() {
|
||||
public function testPoRulesThirteen() {
|
||||
Configure::write('Config.language', 'rule_13_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -2130,7 +2130,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesThirteen() {
|
||||
public function testMoRulesThirteen() {
|
||||
Configure::write('Config.language', 'rule_13_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -2202,7 +2202,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoRulesFourteen() {
|
||||
public function testPoRulesFourteen() {
|
||||
Configure::write('Config.language', 'rule_14_po');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -2274,7 +2274,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoRulesFourteen() {
|
||||
public function testMoRulesFourteen() {
|
||||
Configure::write('Config.language', 'rule_14_mo');
|
||||
|
||||
$singular = $this->__singular();
|
||||
|
@ -2346,7 +2346,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSetLanguageWithSession () {
|
||||
public function testSetLanguageWithSession () {
|
||||
$_SESSION['Config']['language'] = 'po';
|
||||
$singular = $this->__singular();
|
||||
$this->assertEqual('Po (translated)', $singular);
|
||||
|
@ -2387,7 +2387,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testNoCoreTranslation () {
|
||||
public function testNoCoreTranslation () {
|
||||
Configure::write('Config.language', 'po');
|
||||
$singular = $this->__singular();
|
||||
$this->assertEqual('Po (translated)', $singular);
|
||||
|
@ -2430,7 +2430,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPluginTranslation() {
|
||||
public function testPluginTranslation() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
));
|
||||
|
@ -2474,7 +2474,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoMultipleLineTranslation () {
|
||||
public function testPoMultipleLineTranslation () {
|
||||
Configure::write('Config.language', 'po');
|
||||
|
||||
$string = "This is a multiline translation\n";
|
||||
|
@ -2548,7 +2548,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoNoTranslationNeeded () {
|
||||
public function testPoNoTranslationNeeded () {
|
||||
Configure::write('Config.language', 'po');
|
||||
$result = __('No Translation needed');
|
||||
$this->assertEqual('No Translation needed', $result);
|
||||
|
@ -2560,7 +2560,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPoQuotedString () {
|
||||
public function testPoQuotedString () {
|
||||
$expected = 'this is a "quoted string" (translated)';
|
||||
$this->assertEqual($expected, __('this is a "quoted string"'));
|
||||
}
|
||||
|
@ -2571,7 +2571,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFloatValue() {
|
||||
public function testFloatValue() {
|
||||
Configure::write('Config.language', 'rule_9_po');
|
||||
|
||||
$result = __n('%d = 1', '%d = 0 or > 1', (float)1);
|
||||
|
@ -2593,7 +2593,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCategory() {
|
||||
public function testCategory() {
|
||||
Configure::write('Config.language', 'po');
|
||||
$category = $this->__category();
|
||||
$this->assertEqual('Monetary Po (translated)', $category);
|
||||
|
@ -2605,7 +2605,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testPluginCategory() {
|
||||
public function testPluginCategory() {
|
||||
Configure::write('Config.language', 'po');
|
||||
|
||||
$singular = $this->__domainCategorySingular();
|
||||
|
@ -2622,7 +2622,7 @@ class I18nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCategoryThenSingular() {
|
||||
public function testCategoryThenSingular() {
|
||||
Configure::write('Config.language', 'po');
|
||||
$category = $this->__category();
|
||||
$this->assertEqual('Monetary Po (translated)', $category);
|
||||
|
@ -2631,7 +2631,7 @@ class I18nTest extends CakeTestCase {
|
|||
$this->assertEqual('Po (translated)', $singular);
|
||||
}
|
||||
|
||||
function testTimeDefinition() {
|
||||
public function testTimeDefinition() {
|
||||
Configure::write('Config.language', 'po');
|
||||
$result = __c('d_fmt', 5);
|
||||
$expected = '%m/%d/%Y';
|
||||
|
@ -2646,7 +2646,7 @@ class I18nTest extends CakeTestCase {
|
|||
$this->assertEqual($expected, $result);
|
||||
}
|
||||
|
||||
function testTimeDefinitionJapanese(){
|
||||
public function testTimeDefinitionJapanese(){
|
||||
Configure::write('Config.language', 'ja_jp');
|
||||
$result = __c('d_fmt', 5);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class L10nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGet() {
|
||||
public function testGet() {
|
||||
$l10n = new L10n();
|
||||
|
||||
// Catalog Entry
|
||||
|
@ -84,7 +84,7 @@ class L10nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGetAutoLanguage() {
|
||||
public function testGetAutoLanguage() {
|
||||
$__SERVER = $_SERVER;
|
||||
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'inexistent,en-ca';
|
||||
|
||||
|
@ -118,7 +118,7 @@ class L10nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMap() {
|
||||
public function testMap() {
|
||||
$l10n = new L10n();
|
||||
|
||||
$result = $l10n->map(array('afr', 'af'));
|
||||
|
@ -448,7 +448,7 @@ class L10nTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCatalog() {
|
||||
public function testCatalog() {
|
||||
$l10n = new L10n();
|
||||
|
||||
$result = $l10n->catalog(array('af'));
|
||||
|
|
|
@ -31,7 +31,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUtf8() {
|
||||
public function testUtf8() {
|
||||
$string = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
|
||||
$result = Multibyte::utf8($string);
|
||||
$expected = array(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
|
||||
|
@ -355,7 +355,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAscii() {
|
||||
public function testAscii() {
|
||||
$utf8 = array(33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
|
||||
58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
|
||||
83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
|
||||
|
@ -676,7 +676,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbStripos() {
|
||||
public function testUsingMbStripos() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'f';
|
||||
$result = mb_stripos($string, $find);
|
||||
|
@ -924,7 +924,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteStripos() {
|
||||
public function testMultibyteStripos() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'f';
|
||||
$result = Multibyte::stripos($string, $find);
|
||||
|
@ -1172,7 +1172,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbStristr() {
|
||||
public function testUsingMbStristr() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'f';
|
||||
$result = mb_stristr($string, $find);
|
||||
|
@ -1563,7 +1563,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteStristr() {
|
||||
public function testMultibyteStristr() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'f';
|
||||
$result = Multibyte::stristr($string, $find);
|
||||
|
@ -1954,7 +1954,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbStrlen() {
|
||||
public function testUsingMbStrlen() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$result = mb_strlen($string);
|
||||
$expected = 36;
|
||||
|
@ -2102,7 +2102,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteStrlen() {
|
||||
public function testMultibyteStrlen() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$result = Multibyte::strlen($string);
|
||||
$expected = 36;
|
||||
|
@ -2250,7 +2250,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbStrpos() {
|
||||
public function testUsingMbStrpos() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = mb_strpos($string, $find);
|
||||
|
@ -2498,7 +2498,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteStrpos() {
|
||||
public function testMultibyteStrpos() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = Multibyte::strpos($string, $find);
|
||||
|
@ -2746,7 +2746,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbStrrchr() {
|
||||
public function testUsingMbStrrchr() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = mb_strrchr($string, $find);
|
||||
|
@ -3131,7 +3131,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteStrrchr() {
|
||||
public function testMultibyteStrrchr() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = Multibyte::strrchr($string, $find);
|
||||
|
@ -3516,7 +3516,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbStrrichr() {
|
||||
public function testUsingMbStrrichr() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = mb_strrichr($string, $find);
|
||||
|
@ -3901,7 +3901,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteStrrichr() {
|
||||
public function testMultibyteStrrichr() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = Multibyte::strrichr($string, $find);
|
||||
|
@ -4286,7 +4286,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbStrripos() {
|
||||
public function testUsingMbStrripos() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = mb_strripos($string, $find);
|
||||
|
@ -4539,7 +4539,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteStrripos() {
|
||||
public function testMultibyteStrripos() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = Multibyte::strripos($string, $find);
|
||||
|
@ -4793,7 +4793,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbStrrpos() {
|
||||
public function testUsingMbStrrpos() {
|
||||
$skip = extension_loaded('mbstring') && version_compare(PHP_VERSION, '5.2.0', '<');
|
||||
if ($this->skipIf($skip, '%s PHP version does not support $offset parameter in mb_strrpos().')) {
|
||||
return;
|
||||
|
@ -5051,7 +5051,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteStrrpos() {
|
||||
public function testMultibyteStrrpos() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = Multibyte::strrpos($string, $find);
|
||||
|
@ -5305,7 +5305,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbStrstr() {
|
||||
public function testUsingMbStrstr() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = mb_strstr($string, $find);
|
||||
|
@ -5702,7 +5702,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteStrstr() {
|
||||
public function testMultibyteStrstr() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = Multibyte::strstr($string, $find);
|
||||
|
@ -6099,7 +6099,7 @@ class MultibyteTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbStrtolower() {
|
||||
public function testUsingMbStrtolower() {
|
||||
$string = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~';
|
||||
$result = mb_strtolower($string);
|
||||
$expected = '!"#$%&\'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
|
||||
|
@ -6655,7 +6655,7 @@ mb_strtolower does not work for these strings.
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteStrtolower() {
|
||||
public function testMultibyteStrtolower() {
|
||||
$string = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~';
|
||||
$result = Multibyte::strtolower($string);
|
||||
$expected = '!"#$%&\'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
|
||||
|
@ -7213,7 +7213,7 @@ mb_strtolower does not work for these strings.
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbStrtoupper() {
|
||||
public function testUsingMbStrtoupper() {
|
||||
$string = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
|
||||
$result = mb_strtoupper($string);
|
||||
$expected = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~';
|
||||
|
@ -7759,7 +7759,7 @@ mb_strtoupper does not work for these strings.
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteStrtoupper() {
|
||||
public function testMultibyteStrtoupper() {
|
||||
$string = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
|
||||
$result = Multibyte::strtoupper($string);
|
||||
$expected = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~';
|
||||
|
@ -8312,7 +8312,7 @@ mb_strtoupper does not work for these strings.
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbSubstrCount() {
|
||||
public function testUsingMbSubstrCount() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = mb_substr_count($string, $find);
|
||||
|
@ -8566,7 +8566,7 @@ mb_strtoupper does not work for these strings.
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteSubstrCount() {
|
||||
public function testMultibyteSubstrCount() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$find = 'F';
|
||||
$result = Multibyte::substrCount($string, $find);
|
||||
|
@ -8820,7 +8820,7 @@ mb_strtoupper does not work for these strings.
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testUsingMbSubstr() {
|
||||
public function testUsingMbSubstr() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$result = mb_substr($string, 4, 7);
|
||||
$expected = 'EFGHIJK';
|
||||
|
@ -8979,7 +8979,7 @@ mb_strtoupper does not work for these strings.
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteSubstr() {
|
||||
public function testMultibyteSubstr() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$result = Multibyte::substr($string, 4, 7);
|
||||
$expected = 'EFGHIJK';
|
||||
|
@ -9138,7 +9138,7 @@ mb_strtoupper does not work for these strings.
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultibyteMimeEncode() {
|
||||
public function testMultibyteMimeEncode() {
|
||||
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$result = Multibyte::mimeEncode($string);
|
||||
$this->assertEqual($result, $string);
|
||||
|
|
|
@ -32,7 +32,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$streams = CakeLog::configured();
|
||||
foreach ($streams as $stream) {
|
||||
|
@ -45,7 +45,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testImportingLoggers() {
|
||||
public function testImportingLoggers() {
|
||||
App::build(array(
|
||||
'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
|
@ -74,7 +74,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
* @expectedException CakeLogException
|
||||
* @return void
|
||||
*/
|
||||
function testImportingLoggerFailure() {
|
||||
public function testImportingLoggerFailure() {
|
||||
CakeLog::config('fail', array());
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
* @expectedException CakeLogException
|
||||
* @return void
|
||||
*/
|
||||
function testNotImplementingInterface() {
|
||||
public function testNotImplementingInterface() {
|
||||
CakeLog::config('fail', array('engine' => 'stdClass'));
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAutoConfig() {
|
||||
public function testAutoConfig() {
|
||||
if (file_exists(LOGS . 'error.log')) {
|
||||
unlink(LOGS . 'error.log');
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConfig() {
|
||||
public function testConfig() {
|
||||
CakeLog::config('file', array(
|
||||
'engine' => 'FileLog',
|
||||
'path' => LOGS
|
||||
|
@ -135,7 +135,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
**/
|
||||
function testDrop() {
|
||||
public function testDrop() {
|
||||
CakeLog::config('file', array(
|
||||
'engine' => 'FileLog',
|
||||
'path' => LOGS
|
||||
|
@ -154,7 +154,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLogFileWriting() {
|
||||
public function testLogFileWriting() {
|
||||
if (file_exists(LOGS . 'error.log')) {
|
||||
unlink(LOGS . 'error.log');
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ class FileLogTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLogFileWriting() {
|
||||
public function testLogFileWriting() {
|
||||
if (file_exists(LOGS . 'error.log')) {
|
||||
unlink(LOGS . 'error.log');
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ class FileLogTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testPathSetting() {
|
||||
public function testPathSetting() {
|
||||
$path = TMP . 'tests' . DS;
|
||||
if (file_exists(LOGS . 'error.log')) {
|
||||
unlink(LOGS . 'error.log');
|
||||
|
|
|
@ -265,7 +265,7 @@ class AclBehaviorTest extends CakeTestCase {
|
|||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testSetupMulti() {
|
||||
public function testSetupMulti() {
|
||||
$User = new AclPerson();
|
||||
$this->assertTrue(isset($User->Behaviors->Acl->settings['AclPerson']));
|
||||
$this->assertEqual($User->Behaviors->Acl->settings['AclPerson']['type'], 'both');
|
||||
|
@ -371,7 +371,7 @@ class AclBehaviorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAfterSaveUpdateParentIdNotNull() {
|
||||
public function testAfterSaveUpdateParentIdNotNull() {
|
||||
$aroData = array(
|
||||
'Aro' => array(
|
||||
'model' => 'AclPerson',
|
||||
|
|
|
@ -82,7 +82,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testContainments() {
|
||||
public function testContainments() {
|
||||
$r = $this->__containments($this->Article, array('Comment' => array('conditions' => array('Comment.user_id' => 2))));
|
||||
$this->assertTrue(Set::matches('/Article/keep/Comment/conditions[Comment.user_id=2]', $r));
|
||||
|
||||
|
@ -152,7 +152,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testInvalidContainments() {
|
||||
public function testInvalidContainments() {
|
||||
$this->expectError();
|
||||
$r = $this->__containments($this->Article, array('Comment', 'InvalidBinding'));
|
||||
|
||||
|
@ -166,7 +166,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBeforeFind() {
|
||||
public function testBeforeFind() {
|
||||
$r = $this->Article->find('all', array('contain' => array('Comment')));
|
||||
$this->assertFalse(Set::matches('/User', $r));
|
||||
$this->assertTrue(Set::matches('/Comment', $r));
|
||||
|
@ -241,7 +241,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testContain() {
|
||||
public function testContain() {
|
||||
$this->Article->contain('Comment.User');
|
||||
$r = $this->Article->find('all');
|
||||
$this->assertTrue(Set::matches('/Comment/User', $r));
|
||||
|
@ -257,7 +257,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFindEmbeddedNoBindings() {
|
||||
public function testFindEmbeddedNoBindings() {
|
||||
$result = $this->Article->find('all', array('contain' => false));
|
||||
$expected = array(
|
||||
array('Article' => array(
|
||||
|
@ -282,7 +282,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFindFirstLevel() {
|
||||
public function testFindFirstLevel() {
|
||||
$this->Article->contain('User');
|
||||
$result = $this->Article->find('all', array('recursive' => 1));
|
||||
$expected = array(
|
||||
|
@ -391,7 +391,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFindEmbeddedFirstLevel() {
|
||||
public function testFindEmbeddedFirstLevel() {
|
||||
$result = $this->Article->find('all', array('contain' => array('User')));
|
||||
$expected = array(
|
||||
array(
|
||||
|
@ -498,7 +498,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFindSecondLevel() {
|
||||
public function testFindSecondLevel() {
|
||||
$this->Article->contain(array('Comment' => 'User'));
|
||||
$result = $this->Article->find('all', array('recursive' => 2));
|
||||
$expected = array(
|
||||
|
@ -845,7 +845,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFindEmbeddedSecondLevel() {
|
||||
public function testFindEmbeddedSecondLevel() {
|
||||
$result = $this->Article->find('all', array('contain' => array('Comment' => 'User')));
|
||||
$expected = array(
|
||||
array(
|
||||
|
@ -1188,7 +1188,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFindThirdLevel() {
|
||||
public function testFindThirdLevel() {
|
||||
$this->User->contain(array('ArticleFeatured' => array('Featured' => 'Category')));
|
||||
$result = $this->User->find('all', array('recursive' => 3));
|
||||
$expected = array(
|
||||
|
@ -1509,7 +1509,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFindEmbeddedThirdLevel() {
|
||||
public function testFindEmbeddedThirdLevel() {
|
||||
$result = $this->User->find('all', array('contain' => array('ArticleFeatured' => array('Featured' => 'Category'))));
|
||||
$expected = array(
|
||||
array(
|
||||
|
@ -1827,7 +1827,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSettingsThirdLevel() {
|
||||
public function testSettingsThirdLevel() {
|
||||
$result = $this->User->find('all', array('contain' => array('ArticleFeatured' => array('Featured' => array('Category' => array('id', 'name'))))));
|
||||
$expected = array(
|
||||
array(
|
||||
|
@ -2074,7 +2074,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFindThirdLevelNonReset() {
|
||||
public function testFindThirdLevelNonReset() {
|
||||
$this->User->contain(false, array('ArticleFeatured' => array('Featured' => 'Category')));
|
||||
$result = $this->User->find('all', array('recursive' => 3));
|
||||
$expected = array(
|
||||
|
@ -2399,7 +2399,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFindEmbeddedThirdLevelNonReset() {
|
||||
public function testFindEmbeddedThirdLevelNonReset() {
|
||||
$result = $this->User->find('all', array('reset' => false, 'contain' => array('ArticleFeatured' => array('Featured' => 'Category'))));
|
||||
$expected = array(
|
||||
array(
|
||||
|
@ -2889,7 +2889,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testEmbeddedFindFields() {
|
||||
public function testEmbeddedFindFields() {
|
||||
$result = $this->Article->find('all', array(
|
||||
'contain' => array('User(user)'),
|
||||
'fields' => array('title')
|
||||
|
@ -2960,7 +2960,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHasOneFieldsInContain() {
|
||||
public function testHasOneFieldsInContain() {
|
||||
$this->Article->unbindModel(array(
|
||||
'hasMany' => array('Comment')
|
||||
), true);
|
||||
|
@ -2993,7 +2993,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testFindConditionalBinding() {
|
||||
public function testFindConditionalBinding() {
|
||||
$this->Article->contain(array(
|
||||
'User(user)',
|
||||
'Tag' => array(
|
||||
|
@ -3133,7 +3133,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testOtherFinds() {
|
||||
public function testOtherFinds() {
|
||||
$result = $this->Article->find('count');
|
||||
$expected = 3;
|
||||
$this->assertEqual($expected, $result);
|
||||
|
@ -3197,7 +3197,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testOriginalAssociations() {
|
||||
public function testOriginalAssociations() {
|
||||
$this->Article->Comment->Behaviors->attach('Containable');
|
||||
|
||||
$options = array(
|
||||
|
@ -3497,7 +3497,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAutoFieldsWithMultipleDatabases() {
|
||||
public function testAutoFieldsWithMultipleDatabases() {
|
||||
$config = new DATABASE_CONFIG();
|
||||
|
||||
$skip = $this->skipIf(
|
||||
|
@ -3527,7 +3527,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testAutoFieldsWithRecursiveNegativeOne() {
|
||||
public function testAutoFieldsWithRecursiveNegativeOne() {
|
||||
$this->Article->recursive = -1;
|
||||
$result = $this->Article->field('title', array('Article.title' => 'First Article'));
|
||||
$this->assertNoErrors();
|
||||
|
@ -3539,7 +3539,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testFindAllReturn() {
|
||||
public function testFindAllReturn() {
|
||||
$result = $this->Article->find('all', array(
|
||||
'conditions' => array('Article.id' => 999999999)
|
||||
));
|
||||
|
|
|
@ -57,7 +57,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
ClassRegistry::flush();
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testTranslateModel() {
|
||||
public function testTranslateModel() {
|
||||
$this->loadFixtures('TranslateTable', 'Tag', 'TranslatedItem', 'Translate', 'User', 'TranslatedArticle', 'TranslateArticle');
|
||||
$TestModel = new Tag();
|
||||
$TestModel->translateTable = 'another_i18n';
|
||||
|
@ -99,7 +99,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLocaleFalsePlain() {
|
||||
public function testLocaleFalsePlain() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem', 'User');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -124,7 +124,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLocaleFalseAssociations() {
|
||||
public function testLocaleFalseAssociations() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -179,7 +179,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLocaleSingle() {
|
||||
public function testLocaleSingle() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -236,7 +236,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLocaleSingleWithConditions() {
|
||||
public function testLocaleSingleWithConditions() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -276,7 +276,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLocaleSingleAssociations() {
|
||||
public function testLocaleSingleAssociations() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -337,7 +337,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLocaleMultiple() {
|
||||
public function testLocaleMultiple() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -393,7 +393,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMissingTranslation() {
|
||||
public function testMissingTranslation() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -421,7 +421,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testTranslatedFindList() {
|
||||
public function testTranslatedFindList() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -455,7 +455,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadSelectedFields() {
|
||||
public function testReadSelectedFields() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -491,7 +491,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSaveCreate() {
|
||||
public function testSaveCreate() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -510,7 +510,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSaveUpdate() {
|
||||
public function testSaveUpdate() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -533,7 +533,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultipleCreate() {
|
||||
public function testMultipleCreate() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -572,7 +572,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMultipleUpdate() {
|
||||
public function testMultipleUpdate() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -615,7 +615,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMixedCreateUpdateWithArrayLocale() {
|
||||
public function testMixedCreateUpdateWithArrayLocale() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -657,7 +657,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testValidation() {
|
||||
public function testValidation() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -690,7 +690,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAttachDetach() {
|
||||
public function testAttachDetach() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
@ -740,7 +740,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAnotherTranslateTable() {
|
||||
public function testAnotherTranslateTable() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem', 'TranslateTable');
|
||||
|
||||
$TestModel = new TranslatedItemWithTable();
|
||||
|
@ -764,7 +764,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testTranslateWithAssociations() {
|
||||
public function testTranslateWithAssociations() {
|
||||
$this->loadFixtures('TranslateArticle', 'TranslatedArticle', 'User', 'Comment', 'ArticlesTag', 'Tag');
|
||||
|
||||
$TestModel = new TranslatedArticle();
|
||||
|
@ -858,7 +858,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testTranslateTableWithPrefix() {
|
||||
public function testTranslateTableWithPrefix() {
|
||||
$this->loadFixtures('TranslateWithPrefix', 'TranslatedItem');
|
||||
$TestModel = new TranslatedItem2;
|
||||
$TestModel->locale = 'eng';
|
||||
|
@ -878,7 +878,7 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testUnbindTranslationInfinteLoop() {
|
||||
public function testUnbindTranslationInfinteLoop() {
|
||||
$this->loadFixtures('Translate', 'TranslatedItem');
|
||||
|
||||
$TestModel = new TranslatedItem();
|
||||
|
|
|
@ -64,7 +64,7 @@ class TreeBehaviorAfterTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAftersaveCallback() {
|
||||
public function testAftersaveCallback() {
|
||||
$this->Tree = new AfterTree();
|
||||
|
||||
$expected = array('AfterTree' => array('name' => 'Six and One Half Changed in AfterTree::afterSave() but not in database', 'parent_id' => 6, 'lft' => 11, 'rght' => 12));
|
||||
|
|
|
@ -65,7 +65,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testInitialize() {
|
||||
public function testInitialize() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -83,7 +83,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDetectInvalidLeft() {
|
||||
public function testDetectInvalidLeft() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -110,7 +110,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDetectInvalidRight() {
|
||||
public function testDetectInvalidRight() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -137,7 +137,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDetectInvalidParent() {
|
||||
public function testDetectInvalidParent() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -163,7 +163,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDetectNoneExistantParent() {
|
||||
public function testDetectNoneExistantParent() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -187,7 +187,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRecoverFromMissingParent() {
|
||||
public function testRecoverFromMissingParent() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -211,7 +211,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDetectInvalidParents() {
|
||||
public function testDetectInvalidParents() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -234,7 +234,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDetectInvalidLftsRghts() {
|
||||
public function testDetectInvalidLftsRghts() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -256,7 +256,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDetectEqualLftsRghts() {
|
||||
public function testDetectEqualLftsRghts() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(1, 3);
|
||||
|
@ -284,7 +284,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAddOrphan() {
|
||||
public function testAddOrphan() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -304,7 +304,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAddMiddle() {
|
||||
public function testAddMiddle() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -338,7 +338,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAddInvalid() {
|
||||
public function testAddInvalid() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -363,7 +363,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAddNotIndexedByModel() {
|
||||
public function testAddNotIndexedByModel() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -383,7 +383,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMovePromote() {
|
||||
public function testMovePromote() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -410,7 +410,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveWithWhitelist() {
|
||||
public function testMoveWithWhitelist() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -438,7 +438,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testInsertWithWhitelist() {
|
||||
public function testInsertWithWhitelist() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -457,7 +457,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveBefore() {
|
||||
public function testMoveBefore() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -486,7 +486,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveAfter() {
|
||||
public function testMoveAfter() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -515,7 +515,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveDemoteInvalid() {
|
||||
public function testMoveDemoteInvalid() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -549,7 +549,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveInvalid() {
|
||||
public function testMoveInvalid() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -576,7 +576,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveSelfInvalid() {
|
||||
public function testMoveSelfInvalid() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -603,7 +603,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveUpSuccess() {
|
||||
public function testMoveUpSuccess() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -625,7 +625,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveUpFail() {
|
||||
public function testMoveUpFail() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -648,7 +648,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveUp2() {
|
||||
public function testMoveUp2() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(1, 10);
|
||||
|
@ -679,7 +679,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveUpFirst() {
|
||||
public function testMoveUpFirst() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(1, 10);
|
||||
|
@ -710,7 +710,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveDownSuccess() {
|
||||
public function testMoveDownSuccess() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -732,7 +732,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveDownFail() {
|
||||
public function testMoveDownFail() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -754,7 +754,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveDownLast() {
|
||||
public function testMoveDownLast() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(1, 10);
|
||||
|
@ -785,7 +785,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveDown2() {
|
||||
public function testMoveDown2() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(1, 10);
|
||||
|
@ -816,7 +816,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSaveNoMove() {
|
||||
public function testSaveNoMove() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(1, 10);
|
||||
|
@ -847,7 +847,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveToRootAndMoveUp() {
|
||||
public function testMoveToRootAndMoveUp() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(1, 1);
|
||||
|
@ -872,7 +872,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDelete() {
|
||||
public function testDelete() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -908,7 +908,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRemove() {
|
||||
public function testRemove() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -941,7 +941,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRemoveLastTopParent() {
|
||||
public function testRemoveLastTopParent() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -1009,7 +1009,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testRemoveAndDelete() {
|
||||
public function testRemoveAndDelete() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -1074,7 +1074,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testChildren() {
|
||||
public function testChildren() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -1105,7 +1105,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCountChildren() {
|
||||
public function testCountChildren() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -1126,7 +1126,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGetParentNode() {
|
||||
public function testGetParentNode() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -1145,7 +1145,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGetPath() {
|
||||
public function testGetPath() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 2);
|
||||
|
@ -1166,7 +1166,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testNoAmbiguousColumn() {
|
||||
public function testNoAmbiguousColumn() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->bindModel(array('belongsTo' => array('Dummy' =>
|
||||
|
@ -1199,7 +1199,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReorderTree() {
|
||||
public function testReorderTree() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(3, 3);
|
||||
|
@ -1231,7 +1231,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReorderBigTreeWithQueryCaching() {
|
||||
public function testReorderBigTreeWithQueryCaching() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(2, 10);
|
||||
|
@ -1248,7 +1248,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGenerateTreeListWithSelfJoin() {
|
||||
public function testGenerateTreeListWithSelfJoin() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->bindModel(array('belongsTo' => array('Dummy' =>
|
||||
|
@ -1266,7 +1266,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testArraySyntax() {
|
||||
public function testArraySyntax() {
|
||||
extract($this->settings);
|
||||
$this->Tree = new $modelClass();
|
||||
$this->Tree->initialize(3, 3);
|
||||
|
|
|
@ -65,7 +65,7 @@ class TreeBehaviorScopedTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testStringScope() {
|
||||
public function testStringScope() {
|
||||
$this->Tree = new FlagTree();
|
||||
$this->Tree->initialize(2, 3);
|
||||
|
||||
|
@ -102,7 +102,7 @@ class TreeBehaviorScopedTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testArrayScope() {
|
||||
public function testArrayScope() {
|
||||
$this->Tree = new FlagTree();
|
||||
$this->Tree->initialize(2, 3);
|
||||
|
||||
|
@ -139,7 +139,7 @@ class TreeBehaviorScopedTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveUpWithScope() {
|
||||
public function testMoveUpWithScope() {
|
||||
$this->Ad = new Ad();
|
||||
$this->Ad->Behaviors->attach('Tree', array('scope'=>'Campaign'));
|
||||
$this->Ad->moveUp(6);
|
||||
|
@ -156,7 +156,7 @@ class TreeBehaviorScopedTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMoveDownWithScope() {
|
||||
public function testMoveDownWithScope() {
|
||||
$this->Ad = new Ad();
|
||||
$this->Ad->Behaviors->attach('Tree', array('scope' => 'Campaign'));
|
||||
$this->Ad->moveDown(6);
|
||||
|
@ -174,7 +174,7 @@ class TreeBehaviorScopedTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testTranslatingTree() {
|
||||
public function testTranslatingTree() {
|
||||
$this->Tree = new FlagTree();
|
||||
$this->Tree->cacheQueries = false;
|
||||
$this->Tree->Behaviors->attach('Translate', array('name'));
|
||||
|
|
|
@ -45,7 +45,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setup($model, $config = array()) {
|
||||
public function setup($model, $config = array()) {
|
||||
parent::setup($model, $config);
|
||||
if (isset($config['mangle'])) {
|
||||
$config['mangle'] .= ' mangled';
|
||||
|
@ -61,7 +61,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeFind($model, $query) {
|
||||
public function beforeFind($model, $query) {
|
||||
$settings = $this->settings[$model->alias];
|
||||
if (!isset($settings['beforeFind']) || $settings['beforeFind'] == 'off') {
|
||||
return parent::beforeFind($model, $query);
|
||||
|
@ -90,7 +90,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function afterFind($model, $results, $primary) {
|
||||
public function afterFind($model, $results, $primary) {
|
||||
$settings = $this->settings[$model->alias];
|
||||
if (!isset($settings['afterFind']) || $settings['afterFind'] == 'off') {
|
||||
return parent::afterFind($model, $results, $primary);
|
||||
|
@ -118,7 +118,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeSave($model) {
|
||||
public function beforeSave($model) {
|
||||
$settings = $this->settings[$model->alias];
|
||||
if (!isset($settings['beforeSave']) || $settings['beforeSave'] == 'off') {
|
||||
return parent::beforeSave($model);
|
||||
|
@ -145,7 +145,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function afterSave($model, $created) {
|
||||
public function afterSave($model, $created) {
|
||||
$settings = $this->settings[$model->alias];
|
||||
if (!isset($settings['afterSave']) || $settings['afterSave'] == 'off') {
|
||||
return parent::afterSave($model, $created);
|
||||
|
@ -177,7 +177,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeValidate($model) {
|
||||
public function beforeValidate($model) {
|
||||
$settings = $this->settings[$model->alias];
|
||||
if (!isset($settings['validate']) || $settings['validate'] == 'off') {
|
||||
return parent::beforeValidate($model);
|
||||
|
@ -209,7 +209,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeDelete($model, $cascade = true) {
|
||||
public function beforeDelete($model, $cascade = true) {
|
||||
$settings = $this->settings[$model->alias];
|
||||
if (!isset($settings['beforeDelete']) || $settings['beforeDelete'] == 'off') {
|
||||
return parent::beforeDelete($model, $cascade);
|
||||
|
@ -238,7 +238,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function afterDelete($model) {
|
||||
public function afterDelete($model) {
|
||||
$settings = $this->settings[$model->alias];
|
||||
if (!isset($settings['afterDelete']) || $settings['afterDelete'] == 'off') {
|
||||
return parent::afterDelete($model);
|
||||
|
@ -257,7 +257,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function onError($model, $error) {
|
||||
public function onError($model, $error) {
|
||||
$settings = $this->settings[$model->alias];
|
||||
if (!isset($settings['onError']) || $settings['onError'] == 'off') {
|
||||
return parent::onError($model, $error);
|
||||
|
@ -271,7 +271,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function beforeTest($model) {
|
||||
public function beforeTest($model) {
|
||||
if (!isset($model->beforeTestResult)) {
|
||||
$model->beforeTestResult = array();
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testMethod(Model $model, $param = true) {
|
||||
public function testMethod(Model $model, $param = true) {
|
||||
if ($param === true) {
|
||||
return 'working';
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testData(Model $model) {
|
||||
public function testData(Model $model) {
|
||||
if (!isset($model->data['Apple']['field'])) {
|
||||
return false;
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function validateField(Model $model, $field) {
|
||||
public function validateField(Model $model, $field) {
|
||||
return current($field) === 'Orange';
|
||||
}
|
||||
|
||||
|
@ -329,7 +329,7 @@ class TestBehavior extends ModelBehavior {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function speakEnglish(Model $model, $method, $query) {
|
||||
public function speakEnglish(Model $model, $method, $query) {
|
||||
$method = preg_replace('/look for\s+/', 'Item.name = \'', $method);
|
||||
$query = preg_replace('/^in\s+/', 'Location.name = \'', $query);
|
||||
return $method . '\' AND ' . $query . '\'';
|
||||
|
@ -344,11 +344,11 @@ class TestBehavior extends ModelBehavior {
|
|||
class Test2Behavior extends TestBehavior {
|
||||
public $mapMethods = array('/mappingRobot(\w+)/' => 'mapped');
|
||||
|
||||
function resolveMethod($model, $stuff) {
|
||||
public function resolveMethod($model, $stuff) {
|
||||
|
||||
}
|
||||
|
||||
function mapped($model, $method, $query) {
|
||||
public function mapped($model, $method, $query) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ class Test3Behavior extends TestBehavior{
|
|||
* @package cake.tests.cases.libs.model
|
||||
*/
|
||||
class Test4Behavior extends ModelBehavior{
|
||||
function setup($model, $config = null) {
|
||||
public function setup($model, $config = null) {
|
||||
$model->bindModel(
|
||||
array('hasMany' => array('Comment'))
|
||||
);
|
||||
|
@ -380,7 +380,7 @@ class Test4Behavior extends ModelBehavior{
|
|||
* @package cake.tests.cases.libs.model
|
||||
*/
|
||||
class Test5Behavior extends ModelBehavior{
|
||||
function setup($model, $config = null) {
|
||||
public function setup($model, $config = null) {
|
||||
$model->bindModel(
|
||||
array('belongsTo' => array('User'))
|
||||
);
|
||||
|
@ -393,7 +393,7 @@ class Test5Behavior extends ModelBehavior{
|
|||
* @package cake.tests.cases.libs.model
|
||||
*/
|
||||
class Test6Behavior extends ModelBehavior{
|
||||
function setup($model, $config = null) {
|
||||
public function setup($model, $config = null) {
|
||||
$model->bindModel(
|
||||
array('hasAndBelongsToMany' => array('Tag'))
|
||||
);
|
||||
|
@ -406,7 +406,7 @@ class Test6Behavior extends ModelBehavior{
|
|||
* @package cake.tests.cases.libs.model
|
||||
*/
|
||||
class Test7Behavior extends ModelBehavior{
|
||||
function setup($model, $config = null) {
|
||||
public function setup($model, $config = null) {
|
||||
$model->bindModel(
|
||||
array('hasOne' => array('Attachment'))
|
||||
);
|
||||
|
@ -440,7 +440,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
/**
|
||||
* Tests loading aliased behaviors
|
||||
*/
|
||||
function testLoadAlias() {
|
||||
public function testLoadAlias() {
|
||||
$Apple = new Apple();
|
||||
$this->assertIdentical($Apple->Behaviors->attached(), array());
|
||||
|
||||
|
@ -470,7 +470,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorBinding() {
|
||||
public function testBehaviorBinding() {
|
||||
$Apple = new Apple();
|
||||
$this->assertIdentical($Apple->Behaviors->attached(), array());
|
||||
|
||||
|
@ -535,7 +535,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDetachWithPluginNames() {
|
||||
public function testDetachWithPluginNames() {
|
||||
$Apple = new Apple();
|
||||
$Apple->Behaviors->attach('Plugin.Test');
|
||||
$this->assertTrue(isset($Apple->Behaviors->Test), 'Missing behavior');
|
||||
|
@ -558,7 +558,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @expectedException MissingBehaviorClassException
|
||||
* @return void
|
||||
*/
|
||||
function testInvalidBehaviorCausingCakeError() {
|
||||
public function testInvalidBehaviorCausingCakeError() {
|
||||
$Apple = new Apple();
|
||||
$Apple->Behaviors->attach('NoSuchBehavior');
|
||||
}
|
||||
|
@ -569,7 +569,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorToggling() {
|
||||
public function testBehaviorToggling() {
|
||||
$Apple = new Apple();
|
||||
$expected = $Apple->find('all');
|
||||
$this->assertIdentical($Apple->Behaviors->enabled(), array());
|
||||
|
@ -605,7 +605,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorFindCallbacks() {
|
||||
public function testBehaviorFindCallbacks() {
|
||||
$this->skipIf($this->db instanceof Sqlserver, 'This test is not compatible with SQL Server.');
|
||||
|
||||
$Apple = new Apple();
|
||||
|
@ -664,7 +664,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorHasManyFindCallbacks() {
|
||||
public function testBehaviorHasManyFindCallbacks() {
|
||||
$Apple = new Apple();
|
||||
$Apple->unbindModel(array('hasOne' => array('Sample'), 'belongsTo' => array('Parent')), false);
|
||||
$expected = $Apple->find('all');
|
||||
|
@ -736,7 +736,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorHasOneFindCallbacks() {
|
||||
public function testBehaviorHasOneFindCallbacks() {
|
||||
$Apple = new Apple();
|
||||
$Apple->unbindModel(array('hasMany' => array('Child'), 'belongsTo' => array('Parent')), false);
|
||||
$expected = $Apple->find('all');
|
||||
|
@ -806,7 +806,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorBelongsToFindCallbacks() {
|
||||
public function testBehaviorBelongsToFindCallbacks() {
|
||||
$this->skipIf($this->db instanceof Sqlserver, 'This test is not compatible with SQL Server.');
|
||||
|
||||
$Apple = new Apple();
|
||||
|
@ -875,7 +875,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorSaveCallbacks() {
|
||||
public function testBehaviorSaveCallbacks() {
|
||||
$Sample = new Sample();
|
||||
$record = array('Sample' => array('apple_id' => 6, 'name' => 'sample99'));
|
||||
|
||||
|
@ -938,7 +938,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorDeleteCallbacks() {
|
||||
public function testBehaviorDeleteCallbacks() {
|
||||
$Apple = new Apple();
|
||||
|
||||
$Apple->Behaviors->attach('Test', array('beforeFind' => 'off', 'beforeDelete' => 'off'));
|
||||
|
@ -973,7 +973,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorOnErrorCallback() {
|
||||
public function testBehaviorOnErrorCallback() {
|
||||
$Apple = new Apple();
|
||||
|
||||
$Apple->Behaviors->attach('Test', array('beforeFind' => 'off', 'onError' => 'on'));
|
||||
|
@ -988,7 +988,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorValidateCallback() {
|
||||
public function testBehaviorValidateCallback() {
|
||||
$Apple = new Apple();
|
||||
|
||||
$Apple->Behaviors->attach('Test');
|
||||
|
@ -1017,7 +1017,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorValidateMethods() {
|
||||
public function testBehaviorValidateMethods() {
|
||||
$Apple = new Apple();
|
||||
$Apple->Behaviors->attach('Test');
|
||||
$Apple->validate['color'] = 'validateField';
|
||||
|
@ -1036,7 +1036,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorMethodDispatching() {
|
||||
public function testBehaviorMethodDispatching() {
|
||||
$Apple = new Apple();
|
||||
$Apple->Behaviors->attach('Test');
|
||||
|
||||
|
@ -1062,7 +1062,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorMethodDispatchingWithData() {
|
||||
public function testBehaviorMethodDispatchingWithData() {
|
||||
$Apple = new Apple();
|
||||
$Apple->Behaviors->attach('Test');
|
||||
|
||||
|
@ -1126,7 +1126,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testBehaviorAttachAndDetach() {
|
||||
public function testBehaviorAttachAndDetach() {
|
||||
$Sample = new Sample();
|
||||
$Sample->actsAs = array('Test3' => array('bar'), 'Test2' => array('foo', 'bar'));
|
||||
$Sample->Behaviors->init($Sample->alias, $Sample->actsAs);
|
||||
|
@ -1141,7 +1141,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHasMethodBasic() {
|
||||
public function testHasMethodBasic() {
|
||||
$Sample = new Sample();
|
||||
$Collection = new BehaviorCollection();
|
||||
$Collection->init('Sample', array('Test', 'Test2'));
|
||||
|
@ -1157,7 +1157,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHasMethodMappedMethods() {
|
||||
public function testHasMethodMappedMethods() {
|
||||
$Sample = new Sample();
|
||||
$Collection = new BehaviorCollection();
|
||||
$Collection->init('Sample', array('Test', 'Test2'));
|
||||
|
@ -1171,7 +1171,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testHasMethodAsCallback() {
|
||||
public function testHasMethodAsCallback() {
|
||||
$Sample = new Sample();
|
||||
$Collection = new BehaviorCollection();
|
||||
$Collection->init('Sample', array('Test', 'Test2'));
|
||||
|
|
|
@ -95,7 +95,7 @@ class MyAppSchema extends CakeSchema {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setup($version) {
|
||||
public function setup($version) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -105,7 +105,7 @@ class MyAppSchema extends CakeSchema {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function teardown($version) {
|
||||
public function teardown($version) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -222,7 +222,7 @@ class TestAppSchema extends CakeSchema {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setup($version) {
|
||||
public function setup($version) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -232,7 +232,7 @@ class TestAppSchema extends CakeSchema {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function teardown($version) {
|
||||
public function teardown($version) {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -513,7 +513,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
ConnectionManager::getDataSource('test')->cacheSources = false;
|
||||
$this->Schema = new TestAppSchema();
|
||||
|
@ -524,7 +524,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
if (file_exists(TMP . 'tests' . DS .'schema.php')) {
|
||||
unlink(TMP . 'tests' . DS .'schema.php');
|
||||
|
@ -539,7 +539,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaName() {
|
||||
public function testSchemaName() {
|
||||
$Schema = new CakeSchema();
|
||||
$this->assertEqual(strtolower($Schema->name), strtolower(APP_DIR));
|
||||
|
||||
|
@ -556,7 +556,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaRead() {
|
||||
public function testSchemaRead() {
|
||||
$read = $this->Schema->read(array(
|
||||
'connection' => 'test',
|
||||
'name' => 'TestApp',
|
||||
|
@ -608,7 +608,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaReadWithOddTablePrefix() {
|
||||
public function testSchemaReadWithOddTablePrefix() {
|
||||
$config = ConnectionManager::getDataSource('test')->config;
|
||||
$this->skipIf(!empty($config['prefix']), 'This test can not be executed with datasource prefix set');
|
||||
$SchemaPost = ClassRegistry::init('SchemaPost');
|
||||
|
@ -628,7 +628,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaReadWithTablePrefix() {
|
||||
public function testSchemaReadWithTablePrefix() {
|
||||
$config = ConnectionManager::getDataSource('test')->config;
|
||||
$this->skipIf(!empty($config['prefix']), 'This test can not be executed with datasource prefix set');
|
||||
|
||||
|
@ -650,7 +650,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaReadWithConfigPrefix() {
|
||||
public function testSchemaReadWithConfigPrefix() {
|
||||
$db = ConnectionManager::getDataSource('test');
|
||||
$config = $db->config;
|
||||
$config['prefix'] = 'schema_test_prefix_';
|
||||
|
@ -664,7 +664,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaReadWithPlugins() {
|
||||
public function testSchemaReadWithPlugins() {
|
||||
App::objects('model', null, false);
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
|
@ -693,7 +693,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaReadWithCrossDatabase() {
|
||||
public function testSchemaReadWithCrossDatabase() {
|
||||
$config = new DATABASE_CONFIG();
|
||||
$skip = $this->skipIf(
|
||||
!isset($config->test) || !isset($config->test2),
|
||||
|
@ -736,7 +736,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testGenerateTable() {
|
||||
public function testGenerateTable() {
|
||||
$posts = array(
|
||||
'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'),
|
||||
'author_id' => array('type' => 'integer', 'null' => false),
|
||||
|
@ -756,7 +756,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaWrite() {
|
||||
public function testSchemaWrite() {
|
||||
$write = $this->Schema->write(array('name' => 'MyOtherApp', 'tables' => $this->Schema->tables, 'path' => TMP . 'tests'));
|
||||
$file = file_get_contents(TMP . 'tests' . DS .'schema.php');
|
||||
$this->assertEqual($write, $file);
|
||||
|
@ -772,7 +772,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaComparison() {
|
||||
public function testSchemaComparison() {
|
||||
$New = new MyAppSchema();
|
||||
$compare = $New->compare($this->Schema);
|
||||
$expected = array(
|
||||
|
@ -852,7 +852,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testCompareEmptyStringAndNull() {
|
||||
public function testCompareEmptyStringAndNull() {
|
||||
$One = new CakeSchema(array(
|
||||
'posts' => array(
|
||||
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
|
||||
|
@ -881,7 +881,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testTableParametersAndIndexComparison() {
|
||||
public function testTableParametersAndIndexComparison() {
|
||||
$old = array(
|
||||
'posts' => array(
|
||||
'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'),
|
||||
|
@ -973,7 +973,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaLoading() {
|
||||
public function testSchemaLoading() {
|
||||
$Other = $this->Schema->load(array('name' => 'MyOtherApp', 'path' => TMP . 'tests'));
|
||||
$this->assertEqual($Other->name, 'MyOtherApp');
|
||||
$this->assertEqual($Other->tables, $this->Schema->tables);
|
||||
|
@ -984,7 +984,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaLoadingFromPlugin() {
|
||||
public function testSchemaLoadingFromPlugin() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
));
|
||||
|
@ -1002,7 +1002,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSchemaCreateTable() {
|
||||
public function testSchemaCreateTable() {
|
||||
$db = ConnectionManager::getDataSource('test');
|
||||
$db->cacheSources = false;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testEnumConnectionObjects() {
|
||||
public function testEnumConnectionObjects() {
|
||||
$sources = ConnectionManager::enumConnectionObjects();
|
||||
$this->assertTrue(count($sources) >= 1);
|
||||
|
||||
|
@ -54,7 +54,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGetDataSource() {
|
||||
public function testGetDataSource() {
|
||||
$connections = ConnectionManager::enumConnectionObjects();
|
||||
$this->assertTrue((bool)(count(array_keys($connections) >= 1)));
|
||||
|
||||
|
@ -78,7 +78,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGetPluginDataSource() {
|
||||
public function testGetPluginDataSource() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
));
|
||||
|
@ -100,7 +100,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGetPluginDataSourceAndPluginDriver() {
|
||||
public function testGetPluginDataSourceAndPluginDriver() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
));
|
||||
|
@ -124,7 +124,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGetLocalDataSourceAndPluginDriver() {
|
||||
public function testGetLocalDataSourceAndPluginDriver() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
));
|
||||
|
@ -147,7 +147,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGetPluginDataSourceAndLocalDriver() {
|
||||
public function testGetPluginDataSourceAndLocalDriver() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||
'Model/Datasource/Database' => array(
|
||||
|
@ -173,7 +173,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSourceList() {
|
||||
public function testSourceList() {
|
||||
$sources = ConnectionManager::sourceList();
|
||||
$this->assertTrue(count($sources) >= 1);
|
||||
|
||||
|
@ -187,7 +187,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testGetSourceName() {
|
||||
public function testGetSourceName() {
|
||||
$connections = ConnectionManager::enumConnectionObjects();
|
||||
$name = key($connections);
|
||||
$source = ConnectionManager::getDataSource($name);
|
||||
|
@ -206,7 +206,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testLoadDataSource() {
|
||||
public function testLoadDataSource() {
|
||||
$connections = array(
|
||||
array('classname' => 'Mysql', 'filename' => 'Mysql', 'package' => 'Database'),
|
||||
array('classname' => 'Postgres', 'filename' => 'Postgres', 'package' => 'Database'),
|
||||
|
@ -237,7 +237,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCreateDataSourceWithIntegrationTests() {
|
||||
public function testCreateDataSourceWithIntegrationTests() {
|
||||
$name = 'test_created_connection';
|
||||
|
||||
$connections = ConnectionManager::enumConnectionObjects();
|
||||
|
@ -270,7 +270,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testConnectionData() {
|
||||
public function testConnectionData() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
|
||||
'Model/Datasource' => array(
|
||||
|
|
|
@ -75,7 +75,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setup() {
|
||||
public function setup() {
|
||||
parent::setup();
|
||||
Configure::write('Session', array(
|
||||
'defaults' => 'php',
|
||||
|
@ -93,7 +93,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function teardown() {
|
||||
public function teardown() {
|
||||
if (TestCakeSession::started()) {
|
||||
TestCakeSession::clear();
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSessionConfigIniSetting() {
|
||||
public function testSessionConfigIniSetting() {
|
||||
$_SESSION = null;
|
||||
|
||||
Configure::write('Session', array(
|
||||
|
@ -130,7 +130,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionPath() {
|
||||
public function testSessionPath() {
|
||||
TestCakeSession::init('/index.php');
|
||||
$this->assertEquals(TestCakeSession::$path, '/');
|
||||
|
||||
|
@ -144,7 +144,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCakeSessionPathEmpty() {
|
||||
public function testCakeSessionPathEmpty() {
|
||||
TestCakeSession::init('');
|
||||
$this->assertEquals(TestCakeSession::$path, '/', 'Session path is empty, with "" as $base needs to be /');
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCakeSessionPathContainsQuestion() {
|
||||
public function testCakeSessionPathContainsQuestion() {
|
||||
TestCakeSession::init('/index.php?');
|
||||
$this->assertEquals(TestCakeSession::$path, '/');
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSetHost() {
|
||||
public function testSetHost() {
|
||||
TestCakeSession::init();
|
||||
TestCakeSession::setHost('cakephp.org');
|
||||
$this->assertEquals(TestCakeSession::$host, 'cakephp.org');
|
||||
|
@ -178,7 +178,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSetHostWithPort() {
|
||||
public function testSetHostWithPort() {
|
||||
TestCakeSession::init();
|
||||
TestCakeSession::setHost('cakephp.org:443');
|
||||
$this->assertEquals(TestCakeSession::$host, 'cakephp.org');
|
||||
|
@ -189,7 +189,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testValidBogusUserAgent() {
|
||||
public function testValidBogusUserAgent() {
|
||||
Configure::write('Session.checkAgent', true);
|
||||
TestCakeSession::start();
|
||||
$this->assertTrue(TestCakeSession::valid(), 'Newly started session should be valid');
|
||||
|
@ -203,7 +203,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testValidTimeExpiry() {
|
||||
public function testValidTimeExpiry() {
|
||||
Configure::write('Session.checkAgent', true);
|
||||
TestCakeSession::start();
|
||||
$this->assertTrue(TestCakeSession::valid(), 'Newly started session should be valid');
|
||||
|
@ -218,7 +218,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCheck() {
|
||||
public function testCheck() {
|
||||
TestCakeSession::write('SessionTestCase', 'value');
|
||||
$this->assertTrue(TestCakeSession::check('SessionTestCase'));
|
||||
|
||||
|
@ -231,7 +231,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSimpleRead() {
|
||||
public function testSimpleRead() {
|
||||
TestCakeSession::write('testing', '1,2,3');
|
||||
$result = TestCakeSession::read('testing');
|
||||
$this->assertEquals('1,2,3', $result);
|
||||
|
@ -259,7 +259,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testReadyEmpty() {
|
||||
public function testReadyEmpty() {
|
||||
$this->assertFalse(TestCakeSession::read(''));
|
||||
}
|
||||
|
||||
|
@ -269,7 +269,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testWriteArray() {
|
||||
public function testWriteArray() {
|
||||
$result = TestCakeSession::write(array(
|
||||
'one' => 1,
|
||||
'two' => 2,
|
||||
|
@ -288,7 +288,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testWriteEmptyKey() {
|
||||
public function testWriteEmptyKey() {
|
||||
$this->assertFalse(TestCakeSession::write('', 'graham'));
|
||||
$this->assertFalse(TestCakeSession::write('', ''));
|
||||
$this->assertFalse(TestCakeSession::write(''));
|
||||
|
@ -300,7 +300,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testId() {
|
||||
public function testId() {
|
||||
TestCakeSession::destroy();
|
||||
|
||||
$result = TestCakeSession::id();
|
||||
|
@ -318,7 +318,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testStarted() {
|
||||
public function testStarted() {
|
||||
unset($_SESSION);
|
||||
$_SESSION = null;
|
||||
|
||||
|
@ -333,7 +333,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testError() {
|
||||
public function testError() {
|
||||
TestCakeSession::read('Does.not.exist');
|
||||
$result = TestCakeSession::error();
|
||||
$this->assertEquals("Does.not.exist doesn't exist", $result);
|
||||
|
@ -349,7 +349,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDelete() {
|
||||
public function testDelete() {
|
||||
$this->assertTrue(TestCakeSession::write('Delete.me', 'Clearing out'));
|
||||
$this->assertTrue(TestCakeSession::delete('Delete.me'));
|
||||
$this->assertFalse(TestCakeSession::check('Delete.me'));
|
||||
|
@ -367,7 +367,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testDestroy() {
|
||||
public function testDestroy() {
|
||||
TestCakeSession::write('bulletProof', 'invicible');
|
||||
$id = TestCakeSession::id();
|
||||
TestCakeSession::destroy();
|
||||
|
@ -382,7 +382,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCheckingSavedEmpty() {
|
||||
public function testCheckingSavedEmpty() {
|
||||
$this->assertTrue(TestCakeSession::write('SessionTestCase', 0));
|
||||
$this->assertTrue(TestCakeSession::check('SessionTestCase'));
|
||||
|
||||
|
@ -402,7 +402,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCheckKeyWithSpaces() {
|
||||
public function testCheckKeyWithSpaces() {
|
||||
$this->assertTrue(TestCakeSession::write('Session Test', "test"));
|
||||
$this->assertEquals('test', TestCakeSession::check('Session Test'));
|
||||
TestCakeSession::delete('Session Test');
|
||||
|
@ -417,7 +417,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCheckEmpty() {
|
||||
public function testCheckEmpty() {
|
||||
$this->assertFalse(TestCakeSession::check());
|
||||
}
|
||||
|
||||
|
@ -426,7 +426,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testKeyExploit() {
|
||||
public function testKeyExploit() {
|
||||
$key = "a'] = 1; phpinfo(); \$_SESSION['a";
|
||||
$result = TestCakeSession::write($key, 'haxored');
|
||||
$this->assertTrue($result);
|
||||
|
@ -441,7 +441,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadingSavedEmpty() {
|
||||
public function testReadingSavedEmpty() {
|
||||
TestCakeSession::write('SessionTestCase', 0);
|
||||
$this->assertEquals(0, TestCakeSession::read('SessionTestCase'));
|
||||
|
||||
|
@ -462,7 +462,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCheckUserAgentFalse() {
|
||||
public function testCheckUserAgentFalse() {
|
||||
Configure::write('Session.checkAgent', false);
|
||||
TestCakeSession::setUserAgent(md5('http://randomdomainname.com' . Configure::read('Security.salt')));
|
||||
$this->assertTrue(TestCakeSession::valid());
|
||||
|
@ -474,7 +474,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testCheckUserAgentTrue() {
|
||||
public function testCheckUserAgentTrue() {
|
||||
Configure::write('Session.checkAgent', true);
|
||||
TestCakeSession::$error = false;
|
||||
$agent = md5('http://randomdomainname.com' . Configure::read('Security.salt'));
|
||||
|
@ -490,7 +490,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadAndWriteWithCakeStorage() {
|
||||
public function testReadAndWriteWithCakeStorage() {
|
||||
Configure::write('Session.defaults', 'cake');
|
||||
|
||||
TestCakeSession::init();
|
||||
|
@ -525,7 +525,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testUsingAppLibsHandler() {
|
||||
public function testUsingAppLibsHandler() {
|
||||
App::build(array(
|
||||
'Model/Datasource/Session' => array(
|
||||
CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS . 'Session' . DS
|
||||
|
@ -549,7 +549,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testUsingPluginHandler() {
|
||||
public function testUsingPluginHandler() {
|
||||
App::build(array(
|
||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
), true);
|
||||
|
@ -573,7 +573,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadAndWriteWithCacheStorage() {
|
||||
public function testReadAndWriteWithCacheStorage() {
|
||||
Configure::write('Session.defaults', 'cache');
|
||||
|
||||
TestCakeSession::init();
|
||||
|
@ -608,7 +608,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testReadAndWriteWithCustomCacheConfig() {
|
||||
public function testReadAndWriteWithCustomCacheConfig() {
|
||||
Configure::write('Session.defaults', 'cache');
|
||||
Configure::write('Session.handler.config', 'session_test');
|
||||
|
||||
|
@ -633,7 +633,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testReadAndWriteWithDatabaseStorage() {
|
||||
public function testReadAndWriteWithDatabaseStorage() {
|
||||
Configure::write('Session.defaults', 'database');
|
||||
Configure::write('Session.handler.table', 'sessions');
|
||||
Configure::write('Session.handler.model', 'Session');
|
||||
|
@ -676,7 +676,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionTimeout() {
|
||||
public function testSessionTimeout() {
|
||||
Configure::write('debug', 2);
|
||||
Configure::write('Session.autoRegenerate', false);
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
* @group quoting
|
||||
* @return void
|
||||
*/
|
||||
function testLocalizedFloats() {
|
||||
public function testLocalizedFloats() {
|
||||
$this->skipIf(DS === '\\', 'The locale is not supported in Windows and affect the others tests.');
|
||||
|
||||
$restore = setlocale(LC_ALL, null);
|
||||
|
@ -167,7 +167,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testTinyintCasting() {
|
||||
public function testTinyintCasting() {
|
||||
$this->Dbo->cacheSources = false;
|
||||
$tableName = 'tinyint_' . uniqid();
|
||||
$this->Dbo->rawQuery('CREATE TABLE ' . $this->Dbo->fullTableName($tableName) . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id));');
|
||||
|
@ -270,7 +270,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testBuildColumn() {
|
||||
public function testBuildColumn() {
|
||||
$restore = $this->Dbo->columns;
|
||||
$this->Dbo->columns = array('varchar(255)' => 1);
|
||||
$data = array(
|
||||
|
@ -307,7 +307,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
* @group indices
|
||||
* @return void
|
||||
*/
|
||||
function testIndexOnMySQL4Output() {
|
||||
public function testIndexOnMySQL4Output() {
|
||||
$name = $this->Dbo->fullTableName('simple');
|
||||
|
||||
$mockDbo = $this->getMock('Mysql', array('connect', '_execute', 'getVersion'));
|
||||
|
@ -458,7 +458,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
* @group indices
|
||||
* @return void
|
||||
*/
|
||||
function testAlterSchemaIndexes() {
|
||||
public function testAlterSchemaIndexes() {
|
||||
$this->Dbo->cacheSources = $this->Dbo->testing = false;
|
||||
$table = $this->Dbo->fullTableName('altertest');
|
||||
|
||||
|
@ -558,7 +558,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testBlobSaving() {
|
||||
public function testBlobSaving() {
|
||||
$this->loadFixtures('BinaryTest');
|
||||
$this->Dbo->cacheSources = false;
|
||||
$data = "GIF87ab |