mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
remove unused local vars
This commit is contained in:
parent
51946ff8fd
commit
16be9d4990
70 changed files with 132 additions and 169 deletions
|
@ -398,7 +398,7 @@ class TestTask extends BakeTask {
|
|||
}
|
||||
if ($type == 'hasAndBelongsToMany') {
|
||||
if (!empty($subject->hasAndBelongsToMany[$alias]['with'])) {
|
||||
list($plugin, $joinModel) = pluginSplit($subject->hasAndBelongsToMany[$alias]['with']);
|
||||
list(, $joinModel) = pluginSplit($subject->hasAndBelongsToMany[$alias]['with']);
|
||||
} else {
|
||||
$joinModel = Inflector::classify($subject->hasAndBelongsToMany[$alias]['joinTable']);
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ class TestTask extends BakeTask {
|
|||
$models = $subject->uses;
|
||||
}
|
||||
foreach ($models as $model) {
|
||||
list($plugin, $model) = pluginSplit($model);
|
||||
list(, $model) = pluginSplit($model);
|
||||
$this->_processModel($subject->{$model});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2448,7 +2448,7 @@ class DboSource extends DataSource {
|
|||
if (is_numeric($key) && empty($value)) {
|
||||
continue;
|
||||
} elseif (is_numeric($key) && is_string($value)) {
|
||||
$out[] = $not . $this->_quoteFields($value);
|
||||
$out[] = $this->_quoteFields($value);
|
||||
} elseif ((is_numeric($key) && is_array($value)) || in_array(strtolower(trim($key)), $bool)) {
|
||||
if (in_array(strtolower(trim($key)), $bool)) {
|
||||
$join = ' ' . strtoupper($key) . ' ';
|
||||
|
|
|
@ -1609,7 +1609,7 @@ class Model extends Object implements CakeEventListener {
|
|||
$fields = array();
|
||||
|
||||
if (!is_array($validate)) {
|
||||
$options = array_merge($defaults, compact('validate', 'fieldList', 'callbacks'));
|
||||
$options = array_merge($defaults, compact('validate', 'fieldList'));
|
||||
} else {
|
||||
$options = array_merge($defaults, $validate);
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ class CacheTest extends CakeTestCase {
|
|||
'serialize' => true,
|
||||
'random' => 'wii'
|
||||
));
|
||||
$read = Cache::read('Test', 'invalid');
|
||||
Cache::read('Test', 'invalid');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -402,7 +402,7 @@ class CacheTest extends CakeTestCase {
|
|||
|
||||
Cache::delete('test_cache');
|
||||
|
||||
$global = Cache::settings();
|
||||
Cache::settings();
|
||||
|
||||
Cache::set($_cacheSet);
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ class FileEngineTest extends CakeTestCase {
|
|||
|
||||
$newread = Cache::read('serialize_test', 'file_test');
|
||||
|
||||
$delete = Cache::delete('serialize_test', 'file_test');
|
||||
Cache::delete('serialize_test', 'file_test');
|
||||
|
||||
$this->assertSame($read, serialize($data));
|
||||
|
||||
|
|
|
@ -115,6 +115,7 @@ class AclShellTest extends CakeTestCase {
|
|||
public function testParsingModelAndForeignKey() {
|
||||
$result = $this->Task->parseIdentifier('Model.foreignKey');
|
||||
$expected = array('model' => 'Model', 'foreign_key' => 'foreignKey');
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$result = $this->Task->parseIdentifier('mySuperUser');
|
||||
$this->assertEquals('mySuperUser', $result);
|
||||
|
|
|
@ -294,7 +294,7 @@ class SchemaShellTest extends CakeTestCase {
|
|||
$this->Shell->Schema->path = TMP;
|
||||
$this->Shell->Schema->expects($this->never())->method('read');
|
||||
|
||||
$result = $this->Shell->generate();
|
||||
$this->Shell->generate();
|
||||
unlink(TMP . 'schema.php');
|
||||
}
|
||||
|
||||
|
|
|
@ -128,6 +128,6 @@ class DbConfigTaskTest extends CakeTestCase {
|
|||
)
|
||||
));
|
||||
|
||||
$result = $this->Task->execute();
|
||||
$this->Task->execute();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
array($out, $out, $in)
|
||||
);
|
||||
$this->path = TMP . 'tests' . DS . 'extract_task_test';
|
||||
$Folder = new Folder($this->path . DS . 'locale', true);
|
||||
new Folder($this->path . DS . 'locale', true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -381,7 +381,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
$this->Task->expects($this->at(0))->method('createFile')
|
||||
->with($filename, $this->stringContains('class Article'));
|
||||
|
||||
$result = $this->Task->generateFixtureFile('Article', array());
|
||||
$this->Task->generateFixtureFile('Article', array());
|
||||
CakePlugin::unload();
|
||||
}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
$this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls(99, 1));
|
||||
$this->Task->expects($this->once())->method('err');
|
||||
|
||||
$result = $this->Task->getName('test');
|
||||
$this->Task->getName('test');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -349,7 +349,7 @@ class TestTaskTest extends CakeTestCase {
|
|||
));
|
||||
$keys = ClassRegistry::keys();
|
||||
$this->assertTrue(in_array('test_task_comment', $keys));
|
||||
$object = $this->Task->buildTestSubject('Model', 'TestTaskComment');
|
||||
$this->Task->buildTestSubject('Model', 'TestTaskComment');
|
||||
|
||||
$keys = ClassRegistry::keys();
|
||||
$this->assertFalse(in_array('random', $keys));
|
||||
|
|
|
@ -259,7 +259,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('no-commit', array('boolean' => true));
|
||||
|
||||
$result = $parser->parse(array('--fail', 'other'));
|
||||
$parser->parse(array('--fail', 'other'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -271,7 +271,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
|
|||
$parser = new ConsoleOptionParser('test', false);
|
||||
$parser->addOption('no-commit', array('boolean' => true));
|
||||
|
||||
$result = $parser->parse(array('-f'));
|
||||
$parser->parse(array('-f'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -545,7 +545,7 @@ class ShellTest extends CakeTestCase {
|
|||
$path = TMP . 'shell_test';
|
||||
$file = $path . DS . 'file1.php';
|
||||
|
||||
$Folder = new Folder($path, true);
|
||||
new Folder($path, true);
|
||||
|
||||
$this->Shell->interactive = false;
|
||||
|
||||
|
@ -572,7 +572,7 @@ class ShellTest extends CakeTestCase {
|
|||
|
||||
$path = TMP . 'shell_test';
|
||||
$file = $path . DS . 'file1.php';
|
||||
$Folder = new Folder($path, true);
|
||||
new Folder($path, true);
|
||||
|
||||
$this->Shell->interactive = true;
|
||||
|
||||
|
@ -663,7 +663,6 @@ class ShellTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testRunCommandMain() {
|
||||
$methods = get_class_methods('Shell');
|
||||
$Mock = $this->getMock('Shell', array('main', 'startup'), array(), '', false);
|
||||
|
||||
$Mock->expects($this->once())->method('main')->will($this->returnValue(true));
|
||||
|
@ -677,7 +676,6 @@ class ShellTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testRunCommandWithMethod() {
|
||||
$methods = get_class_methods('Shell');
|
||||
$Mock = $this->getMock('Shell', array('hit_me', 'startup'), array(), '', false);
|
||||
|
||||
$Mock->expects($this->once())->method('hit_me')->will($this->returnValue(true));
|
||||
|
@ -700,7 +698,7 @@ class ShellTest extends CakeTestCase {
|
|||
$Mock->expects($this->never())->method('hr');
|
||||
$Mock->expects($this->once())->method('out');
|
||||
|
||||
$result = $Mock->runCommand('hr', array());
|
||||
$Mock->runCommand('hr', array());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -709,7 +707,6 @@ class ShellTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
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);
|
||||
|
||||
|
@ -762,7 +759,7 @@ class ShellTest extends CakeTestCase {
|
|||
|
||||
$Shell->RunCommand = $task;
|
||||
|
||||
$result = $Shell->runCommand('run_command', array('run_command', 'one', 'value'));
|
||||
$Shell->runCommand('run_command', array('run_command', 'one', 'value'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -78,7 +78,7 @@ class TaskCollectionTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testLoadMissingTask() {
|
||||
$result = $this->Tasks->load('ThisTaskShouldAlwaysBeMissing');
|
||||
$this->Tasks->load('ThisTaskShouldAlwaysBeMissing');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -521,7 +521,7 @@ class DbAclTest extends CakeTestCase {
|
|||
$values = array_map(array(&$this, '_pad'), $values);
|
||||
$permissions[$key] = implode (' ', $values);
|
||||
}
|
||||
$permisssions = array_map(array(&$this, '_pad'), $permissions);
|
||||
$permissions = array_map(array(&$this, '_pad'), $permissions);
|
||||
array_unshift($permissions, 'Current Permissions :');
|
||||
if ($printTreesToo) {
|
||||
debug(array('aros' => $this->Acl->Aro->generateTreeList(), 'acos' => $this->Acl->Aco->generateTreeList()));
|
||||
|
|
|
@ -59,7 +59,6 @@ class PhpAclTest extends CakeTestCase {
|
|||
}
|
||||
|
||||
public function testAroResolve() {
|
||||
$map = $this->Acl->Aro->map;
|
||||
$this->Acl->Aro->map = array(
|
||||
'User' => 'FooModel/nickname',
|
||||
'Role' => 'FooModel/role',
|
||||
|
|
|
@ -61,7 +61,7 @@ class AclComponentTest extends CakeTestCase {
|
|||
public function testConstrutorException() {
|
||||
Configure::write('Acl.classname', 'AclClassNameThatDoesNotExist');
|
||||
$Collection = new ComponentCollection();
|
||||
$acl = new AclComponent($Collection);
|
||||
new AclComponent($Collection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -848,7 +848,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
|
||||
ob_start();
|
||||
$RequestHandler->beforeRedirect($controller, 'request_handler_test/param_method/first/second', 403);
|
||||
$result = ob_get_clean();
|
||||
ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -732,7 +732,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->request->params['_Token']['key'];
|
||||
|
||||
$this->Controller->request->data = $data = array(
|
||||
$this->Controller->request->data = array(
|
||||
'Model' => array('username' => '', 'password' => '', 'valid' => '0'),
|
||||
'_Token' => compact('key', 'fields', 'unlocked')
|
||||
);
|
||||
|
@ -1174,7 +1174,7 @@ class SecurityComponentTest extends CakeTestCase {
|
|||
|
||||
$token = $this->Security->Session->read('_Token');
|
||||
$this->assertEquals(2, count($token['csrfTokens']), 'Missing the csrf token.');
|
||||
foreach ($token['csrfTokens'] as $key => $expires) {
|
||||
foreach ($token['csrfTokens'] as $expires) {
|
||||
$diff = $csrfExpires - $expires;
|
||||
$this->assertTrue($diff === 0 || $diff === 1, 'Token expiry does not match');
|
||||
}
|
||||
|
|
|
@ -230,7 +230,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
$this->Controller->theme = 'TestTheme';
|
||||
$this->Controller->viewClass = 'Theme';
|
||||
$this->Controller->constructClasses();
|
||||
$Scaffold = new TestScaffoldMock($this->Controller, $this->Controller->request);
|
||||
new TestScaffoldMock($this->Controller, $this->Controller->request);
|
||||
|
||||
$this->assertEquals('Scaffold', $this->Controller->viewClass);
|
||||
}
|
||||
|
|
|
@ -239,7 +239,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
*/
|
||||
public function testLoadExceptionOnNonExistantFile() {
|
||||
Configure::config('test', new PhpReader());
|
||||
$result = Configure::load('non_existing_configuration_file', 'test');
|
||||
Configure::load('non_existing_configuration_file', 'test');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -105,7 +105,7 @@ class RequestActionController extends Controller {
|
|||
* @return void
|
||||
*/
|
||||
public function paginate_request_action() {
|
||||
$data = $this->paginate();
|
||||
$this->paginate();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -497,7 +497,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
$ExceptionRenderer->controller->response->expects($this->at(1))->method('_sendHeader')->with('Allow', 'POST, DELETE');
|
||||
ob_start();
|
||||
$ExceptionRenderer->render();
|
||||
$result = ob_get_clean();
|
||||
ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -654,7 +654,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
$this->_deleteLogs();
|
||||
$this->_resetLogConfig();
|
||||
|
||||
$levels = CakeLog::levels(array('spam', 'eggs'));
|
||||
CakeLog::levels(array('spam', 'eggs'));
|
||||
|
||||
$testMessage = 'error message';
|
||||
CakeLog::write('error', $testMessage);
|
||||
|
|
|
@ -152,7 +152,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testInvalidContainments() {
|
||||
$r = $this->_containments($this->Article, array('Comment', 'InvalidBinding'));
|
||||
$this->_containments($this->Article, array('Comment', 'InvalidBinding'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,7 +162,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
*/
|
||||
public function testInvalidContainmentsNoNotices() {
|
||||
$this->Article->Behaviors->attach('Containable', array('notices' => false));
|
||||
$r = $this->_containments($this->Article, array('Comment', 'InvalidBinding'));
|
||||
$this->_containments($this->Article, array('Comment', 'InvalidBinding'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -243,7 +243,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testBeforeFindWithNonExistingBinding() {
|
||||
$r = $this->Article->find('all', array('contain' => array('Comment' => 'NonExistingBinding')));
|
||||
$this->Article->find('all', array('contain' => array('Comment' => 'NonExistingBinding')));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3252,7 +3252,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
|
||||
$firstResult = $this->Article->Comment->find('all', $options);
|
||||
|
||||
$dummyResult = $this->Article->Comment->find('all', array(
|
||||
$this->Article->Comment->find('all', array(
|
||||
'conditions' => array(
|
||||
'User.user' => 'mariano'
|
||||
),
|
||||
|
|
|
@ -579,7 +579,6 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
*/
|
||||
public function testBehaviorToggling() {
|
||||
$Apple = new Apple();
|
||||
$expected = $Apple->find('all');
|
||||
$this->assertSame($Apple->Behaviors->enabled(), array());
|
||||
|
||||
$Apple->Behaviors->init('Apple', array('Test' => array('key' => 'value')));
|
||||
|
@ -687,22 +686,6 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
$Apple->Child->Behaviors->attach('Test', array('before' => 'test'));
|
||||
$this->assertSame($expected, $Apple->find('all'));
|
||||
|
||||
$expected2 = array(
|
||||
array(
|
||||
'Apple' => array('id' => 1),
|
||||
'Child' => array(
|
||||
array('id' => 2, 'name' => 'Bright Red Apple', 'mytime' => '22:57:17'))),
|
||||
array(
|
||||
'Apple' => array('id' => 2),
|
||||
'Child' => array(
|
||||
array('id' => 1, 'name' => 'Red Apple 1', 'mytime' => '22:57:17'),
|
||||
array('id' => 3, 'name' => 'green blue', 'mytime' => '22:57:17'),
|
||||
array('id' => 4, 'name' => 'Test Name', 'mytime' => '22:57:17'))),
|
||||
array(
|
||||
'Apple' => array('id' => 3),
|
||||
'Child' => array())
|
||||
);
|
||||
|
||||
$Apple->Child->Behaviors->attach('Test', array('before' => 'modify'));
|
||||
$result = $Apple->find('all', array('fields' => array('Apple.id'), 'conditions' => array('Apple.id <' => '4')));
|
||||
|
||||
|
@ -1118,7 +1101,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testHasMethodBasic() {
|
||||
$Sample = new Sample();
|
||||
new Sample();
|
||||
$Collection = new BehaviorCollection();
|
||||
$Collection->init('Sample', array('Test', 'Test2'));
|
||||
|
||||
|
@ -1134,7 +1117,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testHasMethodMappedMethods() {
|
||||
$Sample = new Sample();
|
||||
new Sample();
|
||||
$Collection = new BehaviorCollection();
|
||||
$Collection->init('Sample', array('Test', 'Test2'));
|
||||
|
||||
|
@ -1148,7 +1131,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testHasMethodAsCallback() {
|
||||
$Sample = new Sample();
|
||||
new Sample();
|
||||
$Collection = new BehaviorCollection();
|
||||
$Collection->init('Sample', array('Test', 'Test2'));
|
||||
|
||||
|
|
|
@ -596,7 +596,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
ConnectionManager::drop('default');
|
||||
ConnectionManager::create('default', $connections['test']);
|
||||
try {
|
||||
$read = $this->Schema->read(array(
|
||||
$this->Schema->read(array(
|
||||
'connection' => 'default',
|
||||
'name' => 'TestApp',
|
||||
'models' => array('AppModel')
|
||||
|
@ -638,8 +638,6 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
$config = ConnectionManager::getDataSource('test')->config;
|
||||
$this->skipIf(!empty($config['prefix']), 'This test can not be executed with datasource prefix set.');
|
||||
|
||||
$model = new SchemaPrefixAuthUser();
|
||||
|
||||
$Schema = new CakeSchema();
|
||||
$read = $Schema->read(array(
|
||||
'connection' => 'test',
|
||||
|
|
|
@ -62,7 +62,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
$name = 'test_get_datasource';
|
||||
$config = array('datasource' => 'Test2Source');
|
||||
|
||||
$connection = ConnectionManager::create($name, $config);
|
||||
ConnectionManager::create($name, $config);
|
||||
$connections = ConnectionManager::enumConnectionObjects();
|
||||
$this->assertTrue((bool)(count(array_keys($connections) >= 1)));
|
||||
|
||||
|
@ -190,7 +190,6 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testGetSourceName() {
|
||||
$connections = ConnectionManager::enumConnectionObjects();
|
||||
$source = ConnectionManager::getDataSource('test');
|
||||
$result = ConnectionManager::getSourceName($source);
|
||||
|
||||
|
@ -228,7 +227,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
*/
|
||||
public function testLoadDataSourceException() {
|
||||
$connection = array('classname' => 'NonExistentDataSource', 'filename' => 'non_existent');
|
||||
$loaded = ConnectionManager::loadDataSource($connection);
|
||||
ConnectionManager::loadDataSource($connection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1210,7 +1210,7 @@ class MysqlTest extends CakeTestCase {
|
|||
*/
|
||||
protected function _buildRelatedModels(Model $model) {
|
||||
foreach ($model->associations() as $type) {
|
||||
foreach ($model->{$type} as $assoc => $assocData) {
|
||||
foreach ($model->{$type} as $assocData) {
|
||||
if (is_string($assocData)) {
|
||||
$className = $assocData;
|
||||
} elseif (isset($assocData['className'])) {
|
||||
|
@ -2779,7 +2779,7 @@ class MysqlTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testDropSchemaNoSchema() {
|
||||
$result = $this->Dbo->dropSchema(null);
|
||||
$this->Dbo->dropSchema(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3674,7 +3674,7 @@ class MysqlTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testExceptionOnBrokenConnection() {
|
||||
$dbo = new Mysql(array(
|
||||
new Mysql(array(
|
||||
'driver' => 'mysql',
|
||||
'host' => 'imaginary_host',
|
||||
'login' => 'mark',
|
||||
|
|
|
@ -540,7 +540,6 @@ class PostgresTest extends CakeTestCase {
|
|||
CONSTRAINT test_data_types_pkey PRIMARY KEY (id)
|
||||
)');
|
||||
|
||||
$model = new Model(array('name' => 'DatatypeTest', 'ds' => 'test'));
|
||||
$schema = new CakeSchema(array('connection' => 'test'));
|
||||
$result = $schema->read(array(
|
||||
'connection' => 'test',
|
||||
|
|
|
@ -164,7 +164,6 @@ class SqliteTest extends CakeTestCase {
|
|||
$dbName = 'db' . rand() . '$(*%&).db';
|
||||
$this->assertFalse(file_exists(TMP . $dbName));
|
||||
|
||||
$config = $this->Dbo->config;
|
||||
$db = new Sqlite(array_merge($this->Dbo->config, array('database' => TMP . $dbName)));
|
||||
$this->assertTrue(file_exists(TMP . $dbName));
|
||||
|
||||
|
@ -341,27 +340,30 @@ class SqliteTest extends CakeTestCase {
|
|||
'id' => array(
|
||||
'type' => 'integer',
|
||||
'null' => false,
|
||||
'default' => 0,
|
||||
'key' => 'primary'
|
||||
'default' => '',
|
||||
'length' => 11,
|
||||
'key' => 'primary',
|
||||
),
|
||||
'float_field' => array(
|
||||
'type' => 'float',
|
||||
'length' => '5,2',
|
||||
'null' => false,
|
||||
'default' => null
|
||||
'default' => '',
|
||||
'length' => '5,2',
|
||||
),
|
||||
'huge_int' => array(
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'type' => 'biginteger',
|
||||
'null' => true,
|
||||
'default' => null
|
||||
'default' => null,
|
||||
'length' => 20,
|
||||
),
|
||||
'bool' => array(
|
||||
'type' => 'boolean',
|
||||
'null' => false,
|
||||
'default' => false
|
||||
'default' => '0',
|
||||
'length' => null
|
||||
),
|
||||
);
|
||||
$this->assertSame($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -525,7 +525,7 @@ class DboSourceTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testDirectCallThrowsException() {
|
||||
$result = $this->db->query('directCall', array(), $this->Model);
|
||||
$this->db->query('directCall', array(), $this->Model);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1062,7 +1062,10 @@ class DboSourceTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testBuildStatementDefaults() {
|
||||
$conn = $this->getMock('MockPDO');
|
||||
$conn = $this->getMock('MockPDO', array('quote'));
|
||||
$conn->expects($this->at(0))
|
||||
->method('quote')
|
||||
->will($this->returnValue('foo bar'));
|
||||
$db = new DboTestSource;
|
||||
$db->setConnection($conn);
|
||||
$subQuery = $db->buildStatement(
|
||||
|
@ -1076,6 +1079,8 @@ class DboSourceTest extends CakeTestCase {
|
|||
),
|
||||
$this->Model
|
||||
);
|
||||
$expected = 'SELECT DISTINCT(AssetsTag.asset_id) FROM assets_tags AS AssetsTag WHERE Tag.name = foo bar GROUP BY AssetsTag.asset_id ';
|
||||
$this->assertEquals($expected, $subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -96,7 +96,7 @@ class DatabaseSessionTest extends CakeTestCase {
|
|||
*/
|
||||
public function testConstructionSettings() {
|
||||
ClassRegistry::flush();
|
||||
$storage = new DatabaseSession();
|
||||
new DatabaseSession();
|
||||
|
||||
$session = ClassRegistry::getObject('session');
|
||||
$this->assertInstanceOf('SessionTestModel', $session);
|
||||
|
|
|
@ -857,8 +857,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
$larrysArmor = Hash::extract($larry, 'Armor.{n}.ArmorsPlayer');
|
||||
$this->assertEquals(2 , count($larrysArmor));
|
||||
|
||||
$larrysArmorsPlayersIds = Hash::extract($larry, 'Armor.{n}.ArmorsPlayer.id');
|
||||
|
||||
$Player->ArmorsPlayer->id = 3;
|
||||
$Player->ArmorsPlayer->saveField('broken', true); // larry's cloak broke
|
||||
|
||||
|
|
|
@ -364,7 +364,7 @@ class ModelReadTest extends BaseModelTest {
|
|||
$query .= '.published = ? AND ' . $this->db->fullTableName('articles') . '.user_id = ?';
|
||||
$params = array('Y');
|
||||
|
||||
$result = $Article->query($query, $params);
|
||||
$Article->query($query, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -384,7 +384,7 @@ class ModelReadTest extends BaseModelTest {
|
|||
$this->db->fullTableName('articles') . '.published', 'Y'
|
||||
);
|
||||
|
||||
$result = $Article->query($query, $param);
|
||||
$Article->query($query, $param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2996,7 +2996,6 @@ class ModelReadTest extends BaseModelTest {
|
|||
|
||||
$duplicateModel = new NodeAfterFind();
|
||||
$duplicateModel->recursive = 3;
|
||||
$duplicateModelData = $duplicateModel->find('all');
|
||||
|
||||
$noAfterFindModel = new NodeNoAfterFind();
|
||||
$noAfterFindModel->recursive = 3;
|
||||
|
|
|
@ -2139,7 +2139,7 @@ class ModelValidationTest extends BaseModelTest {
|
|||
* @return void
|
||||
*/
|
||||
public function testValidatorTypehintException() {
|
||||
$Validator = new ModelValidator('asdasds');
|
||||
new ModelValidator('asdasds');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -499,10 +499,6 @@ class ModelWriteTest extends BaseModelTest {
|
|||
), false);
|
||||
|
||||
// Count Increase
|
||||
$user = $User->find('first', array(
|
||||
'conditions' => array('id' => 66),
|
||||
'recursive' => -1
|
||||
));
|
||||
$data = array('Post' => array(
|
||||
'id' => 22,
|
||||
'title' => 'New Post',
|
||||
|
@ -2219,7 +2215,6 @@ class ModelWriteTest extends BaseModelTest {
|
|||
public function testCreationWithMultipleDataSameModel() {
|
||||
$this->loadFixtures('Article');
|
||||
$Article = new Article();
|
||||
$SecondaryArticle = new Article();
|
||||
|
||||
$result = $Article->field('title', array('id' => 1));
|
||||
$this->assertEquals('First Article', $result);
|
||||
|
@ -2279,7 +2274,6 @@ class ModelWriteTest extends BaseModelTest {
|
|||
public function testCreationWithMultipleDataSameModelManualInstances() {
|
||||
$this->loadFixtures('PrimaryModel');
|
||||
$Primary = new PrimaryModel();
|
||||
$Secondary = new PrimaryModel();
|
||||
|
||||
$result = $Primary->field('primary_name', array('id' => 1));
|
||||
$this->assertEquals('Primary Name Existing', $result);
|
||||
|
@ -4028,7 +4022,7 @@ class ModelWriteTest extends BaseModelTest {
|
|||
public function testSaveAllAssociatedTransactionNoRollback() {
|
||||
$testDb = ConnectionManager::getDataSource('test');
|
||||
|
||||
$mock = $this->getMock(
|
||||
$this->getMock(
|
||||
'DboSource',
|
||||
array('connect', 'rollback', 'describe', 'create', 'update', 'begin'),
|
||||
array(),
|
||||
|
@ -5455,7 +5449,7 @@ class ModelWriteTest extends BaseModelTest {
|
|||
public function testSaveAssociatedTransactionNoRollback() {
|
||||
$testDb = ConnectionManager::getDataSource('test');
|
||||
|
||||
$mock = $this->getMock(
|
||||
$this->getMock(
|
||||
'DboSource',
|
||||
array('connect', 'rollback', 'describe', 'create', 'begin'),
|
||||
array(),
|
||||
|
|
|
@ -76,11 +76,6 @@ class CakeValidationSetTest extends CakeTestCase {
|
|||
public function testGetRule() {
|
||||
$rules = array('notEmpty' => array('rule' => 'notEmpty', 'message' => 'Can not be empty'));
|
||||
$Field = new CakeValidationSet('title', $rules);
|
||||
$data = array(
|
||||
'title' => '',
|
||||
'body' => 'a body'
|
||||
);
|
||||
|
||||
$result = $Field->getRule('notEmpty');
|
||||
$this->assertInstanceOf('CakeValidationRule', $result);
|
||||
$this->assertEquals('notEmpty', $result->rule);
|
||||
|
|
|
@ -699,7 +699,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
public function testExtendTransport() {
|
||||
$this->setExpectedException('SocketException');
|
||||
$this->CakeEmail->transport('Extend');
|
||||
$result = $this->CakeEmail->transportClass();
|
||||
$this->CakeEmail->transportClass();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -991,7 +991,6 @@ class CakeEmailTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testSendWithLog() {
|
||||
$path = CAKE . 'Test' . DS . 'test_app' . DS . 'tmp' . DS;
|
||||
CakeLog::config('email', array(
|
||||
'engine' => 'FileLog',
|
||||
'path' => TMP
|
||||
|
@ -1238,7 +1237,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->config(array());
|
||||
$this->CakeEmail->viewVars(array('value' => 12345));
|
||||
$this->CakeEmail->emailFormat('both');
|
||||
$result = $this->CakeEmail->send();
|
||||
$this->CakeEmail->send();
|
||||
|
||||
$message = $this->CakeEmail->message();
|
||||
$boundary = $this->CakeEmail->getBoundary();
|
||||
|
@ -1338,7 +1337,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->config(array('empty'));
|
||||
$this->CakeEmail->template('default', 'default');
|
||||
$this->CakeEmail->emailFormat('both');
|
||||
$result = $this->CakeEmail->send();
|
||||
$this->CakeEmail->send();
|
||||
|
||||
$expected = '<p>This email was sent using the <a href="http://cakephp.org">CakePHP Framework</a></p>';
|
||||
$this->assertContains($expected, $this->CakeEmail->message(CakeEmail::MESSAGE_HTML));
|
||||
|
|
|
@ -458,7 +458,7 @@ class HttpResponseTest extends CakeTestCase {
|
|||
*/
|
||||
public function testDecodeChunkedBodyError() {
|
||||
$encoded = "19\r\nThis is a chunked message\r\nE\r\n\nThat is cool\n\r\n";
|
||||
$r = $this->HttpResponse->decodeChunkedBody($encoded);
|
||||
$this->HttpResponse->decodeChunkedBody($encoded);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -561,7 +561,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
$expectation['request']['raw'] = $expectation['request']['line'] . $expectation['request']['header'] . "\r\n" . $raw;
|
||||
|
||||
$r = array('config' => $this->Socket->config, 'request' => $this->Socket->request);
|
||||
$v = $this->assertEquals($r, $expectation, 'Failed test #' . $i . ' ');
|
||||
$this->assertEquals($r, $expectation, 'Failed test #' . $i . ' ');
|
||||
$expectation['request']['raw'] = $raw;
|
||||
}
|
||||
|
||||
|
@ -587,7 +587,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
),
|
||||
'method' => 'GET'
|
||||
);
|
||||
$response = $this->Socket->request($request);
|
||||
$this->Socket->request($request);
|
||||
$this->assertContains('Host: cakephp.org:8080', $this->Socket->request['header']);
|
||||
}
|
||||
|
||||
|
@ -607,7 +607,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
),
|
||||
'method' => 'GET'
|
||||
);
|
||||
$response = $this->Socket->request($request);
|
||||
$this->Socket->request($request);
|
||||
$this->assertContains("GET /index.php?somestring HTTP/1.1", $this->Socket->request['line']);
|
||||
}
|
||||
|
||||
|
@ -620,7 +620,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
public function testRequestNotAllowedUri() {
|
||||
$this->Socket->reset();
|
||||
$request = array('uri' => '*', 'method' => 'GET');
|
||||
$response = $this->Socket->request($request);
|
||||
$this->Socket->request($request);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -844,7 +844,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
$this->Socket->expects($this->at(1))->method('read')->will($this->returnValue($serverResponse1));
|
||||
$this->Socket->expects($this->at(4))->method('read')->will($this->returnValue($serverResponse2));
|
||||
|
||||
$response = $this->Socket->request($request);
|
||||
$this->Socket->request($request);
|
||||
$this->assertEquals(1, $this->Socket->request['redirect']);
|
||||
}
|
||||
|
||||
|
@ -1216,7 +1216,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testBadBuildRequestLine() {
|
||||
$r = $this->Socket->buildRequestLine('Foo');
|
||||
$this->Socket->buildRequestLine('Foo');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1226,7 +1226,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testBadBuildRequestLine2() {
|
||||
$r = $this->Socket->buildRequestLine("GET * HTTP/1.1\r\n");
|
||||
$this->Socket->buildRequestLine("GET * HTTP/1.1\r\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1709,7 +1709,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
$this->skipIf(!extension_loaded('openssl'), 'OpenSSL is not enabled cannot test SSL.');
|
||||
$socket = new HttpSocket();
|
||||
try {
|
||||
$result = $socket->get('https://typography.com');
|
||||
$socket->get('https://typography.com');
|
||||
$this->markTestSkipped('Found valid certificate, was expecting invalid certificate.');
|
||||
} catch (SocketException $e) {
|
||||
$message = $e->getMessage();
|
||||
|
|
|
@ -617,7 +617,7 @@ class DispatcherTest extends CakeTestCase {
|
|||
$request = new CakeRequest("/");
|
||||
$event = new CakeEvent('DispatcherTest', $Dispatcher, array('request' => $request));
|
||||
$Dispatcher->parseParams($event);
|
||||
$test = $Dispatcher->parseParams($event);
|
||||
$Dispatcher->parseParams($event);
|
||||
$this->assertEquals("My Posted Content", $request['data']['testdata']);
|
||||
}
|
||||
|
||||
|
|
|
@ -2290,7 +2290,7 @@ class RouterTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testUsingCustomRouteClass() {
|
||||
$mock = $this->getMock('CakeRoute', array(), array(), 'MockConnectedRoute', false);
|
||||
$this->getMock('CakeRoute', array(), array(), 'MockConnectedRoute', false);
|
||||
$routes = Router::connect(
|
||||
'/:slug',
|
||||
array('controller' => 'posts', 'action' => 'view'),
|
||||
|
|
|
@ -276,7 +276,7 @@ class ControllerTestCaseTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testTestActionWithPlugin() {
|
||||
$Controller = $this->Case->generate('TestPlugin.Tests');
|
||||
$this->Case->generate('TestPlugin.Tests');
|
||||
$this->Case->testAction('/test_plugin/tests/index');
|
||||
$this->assertEquals('It is a variable', $this->Case->controller->viewVars['test_value']);
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ class ControllerTestCaseTest extends CakeTestCase {
|
|||
include CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS . 'routes.php';
|
||||
|
||||
$this->Case->loadRoutes = false;
|
||||
$result = $this->Case->testAction('/tests_apps/missing_action.json', array('return' => 'view'));
|
||||
$this->Case->testAction('/tests_apps/missing_action.json', array('return' => 'view'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -520,7 +520,7 @@ class ControllerTestCaseTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testTestActionWithMultipleRedirect() {
|
||||
$Controller = $this->Case->generate('TestsApps');
|
||||
$this->Case->generate('TestsApps');
|
||||
|
||||
$options = array('method' => 'get');
|
||||
$this->Case->testAction('/tests_apps/redirect_to', $options);
|
||||
|
|
|
@ -636,7 +636,7 @@ class CakeNumberTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testFromReadableSizeException() {
|
||||
$result = $this->Number->fromReadableSize('bogus', false);
|
||||
$this->Number->fromReadableSize('bogus', false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -223,7 +223,7 @@ class ClassRegistryTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testClassRegistryFlush() {
|
||||
$Tag = ClassRegistry::init('RegisterArticleTag');
|
||||
ClassRegistry::init('RegisterArticleTag');
|
||||
|
||||
$ArticleTag = ClassRegistry::getObject('RegisterArticleTag');
|
||||
$this->assertTrue(is_a($ArticleTag, 'RegisterArticleTag'));
|
||||
|
|
|
@ -65,7 +65,7 @@ class DebuggerTest extends CakeTestCase {
|
|||
public function testDocRef() {
|
||||
ini_set('docref_root', '');
|
||||
$this->assertEquals(ini_get('docref_root'), '');
|
||||
$debugger = new Debugger();
|
||||
new Debugger();
|
||||
$this->assertEquals(ini_get('docref_root'), 'http://php.net/');
|
||||
}
|
||||
|
||||
|
|
|
@ -130,8 +130,6 @@ class FileTest extends CakeTestCase {
|
|||
$this->skipIf(DIRECTORY_SEPARATOR === '\\', 'File permissions tests not supported on Windows.');
|
||||
|
||||
$dir = TMP . 'tests' . DS . 'permissions' . DS;
|
||||
$Folder = new Folder($dir);
|
||||
|
||||
$old = umask();
|
||||
|
||||
umask(0002);
|
||||
|
|
|
@ -84,7 +84,7 @@ class GenericObjectCollection extends ObjectCollection {
|
|||
* @return array List of loaded objects
|
||||
*/
|
||||
public function load($object, $settings = array()) {
|
||||
list($plugin, $name) = pluginSplit($object);
|
||||
list(, $name) = pluginSplit($object);
|
||||
if (isset($this->_loaded[$name])) {
|
||||
return $this->_loaded[$name];
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ class ObjectCollectionTest extends CakeTestCase {
|
|||
$this->Objects->TriggerMockSecond->expects($this->never())
|
||||
->method('callback');
|
||||
|
||||
$result = $this->Objects->trigger(
|
||||
$this->Objects->trigger(
|
||||
'callback',
|
||||
array(array('value')),
|
||||
array('modParams' => 2)
|
||||
|
|
|
@ -69,7 +69,7 @@ class SecurityTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testHashInvalidSalt() {
|
||||
$result = Security::hash('someKey', 'blowfish', true);
|
||||
Security::hash('someKey', 'blowfish', true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -79,7 +79,7 @@ class SecurityTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testHashAnotherInvalidSalt() {
|
||||
$result = Security::hash('someKey', 'blowfish', '$1$lksdjoijfaoijs');
|
||||
Security::hash('someKey', 'blowfish', '$1$lksdjoijfaoijs');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -89,7 +89,7 @@ class SecurityTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testHashYetAnotherInvalidSalt() {
|
||||
$result = Security::hash('someKey', 'blowfish', '$2a$10$123');
|
||||
Security::hash('someKey', 'blowfish', '$2a$10$123');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -233,7 +233,7 @@ class SecurityTest extends CakeTestCase {
|
|||
public function testCipherEmptyKey() {
|
||||
$txt = 'some_text';
|
||||
$key = '';
|
||||
$result = Security::cipher($txt, $key);
|
||||
Security::cipher($txt, $key);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -268,7 +268,7 @@ class SecurityTest extends CakeTestCase {
|
|||
public function testRijndaelInvalidOperation() {
|
||||
$txt = 'The quick brown fox jumped over the lazy dog.';
|
||||
$key = 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi';
|
||||
$result = Security::rijndael($txt, $key, 'foo');
|
||||
Security::rijndael($txt, $key, 'foo');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -280,7 +280,7 @@ class SecurityTest extends CakeTestCase {
|
|||
public function testRijndaelInvalidKey() {
|
||||
$txt = 'The quick brown fox jumped over the lazy dog.';
|
||||
$key = 'too small';
|
||||
$result = Security::rijndael($txt, $key, 'encrypt');
|
||||
Security::rijndael($txt, $key, 'encrypt');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1020,7 +1020,7 @@ XML;
|
|||
</records>
|
||||
</data>
|
||||
XML;
|
||||
$result = $obj->asXML();
|
||||
$obj->asXML();
|
||||
$this->assertXmlStringEqualsXmlString($expected, $obj->asXML());
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$this->Controller->action = 'view';
|
||||
|
||||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
$View->render('index');
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'posts_view_風街ろまん.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
@ -338,7 +338,7 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$this->Controller->cache_parsing();
|
||||
|
||||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
$View->render('index');
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
|
|
@ -1364,7 +1364,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->Form->request['_Token'] = array('key' => 'testKey');
|
||||
$this->assertEquals(array(), $this->Form->fields);
|
||||
|
||||
$result = $this->Form->file('Attachment.file');
|
||||
$this->Form->file('Attachment.file');
|
||||
$expected = array(
|
||||
'Attachment.file.name', 'Attachment.file.type', 'Attachment.file.tmp_name',
|
||||
'Attachment.file.error', 'Attachment.file.size'
|
||||
|
@ -4477,7 +4477,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->Form->request['_Token'] = array('key' => 'testkey');
|
||||
$this->assertEquals(array(), $this->Form->fields);
|
||||
|
||||
$result = $this->Form->select(
|
||||
$this->Form->select(
|
||||
'Model.select',
|
||||
array(),
|
||||
array('multiple' => true)
|
||||
|
|
|
@ -449,7 +449,7 @@ class HtmlHelperTest extends CakeTestCase {
|
|||
App::uses('File', 'Utility');
|
||||
|
||||
$testfile = WWW_ROOT . 'theme' . DS . 'test_theme' . DS . 'img' . DS . '__cake_test_image.gif';
|
||||
$File = new File($testfile, true);
|
||||
new File($testfile, true);
|
||||
|
||||
App::build(array(
|
||||
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
|
||||
|
@ -987,7 +987,7 @@ class HtmlHelperTest extends CakeTestCase {
|
|||
App::uses('File', 'Utility');
|
||||
|
||||
$testfile = WWW_ROOT . 'theme' . DS . 'test_theme' . DS . 'js' . DS . '__test_js.js';
|
||||
$File = new File($testfile, true);
|
||||
new File($testfile, true);
|
||||
|
||||
App::build(array(
|
||||
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
|
||||
|
@ -1955,7 +1955,7 @@ class HtmlHelperTest extends CakeTestCase {
|
|||
* @expectedException ConfigureException
|
||||
*/
|
||||
public function testLoadConfigWrongFile() {
|
||||
$result = $this->Html->loadConfig('wrong_file');
|
||||
$this->Html->loadConfig('wrong_file');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1966,7 +1966,7 @@ class HtmlHelperTest extends CakeTestCase {
|
|||
*/
|
||||
public function testLoadConfigWrongReader() {
|
||||
$path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS;
|
||||
$result = $this->Html->loadConfig(array('htmlhelper_tags', 'wrong_reader'), $path);
|
||||
$this->Html->loadConfig(array('htmlhelper_tags', 'wrong_reader'), $path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -319,7 +319,7 @@ class JsHelperTest extends CakeTestCase {
|
|||
->method('append')
|
||||
->with('script', $this->matchesRegularExpression('#<script type="text\/javascript">window.app \= \{"foo"\:1\}\;<\/script>#'));
|
||||
|
||||
$result = $this->Js->writeBuffer(array('onDomReady' => false, 'inline' => false, 'safe' => false));
|
||||
$this->Js->writeBuffer(array('onDomReady' => false, 'inline' => false, 'safe' => false));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -338,7 +338,7 @@ class JsHelperTest extends CakeTestCase {
|
|||
|
||||
$this->Js->buffer('alert("test");');
|
||||
$this->Js->TestJsEngine->expects($this->never())->method('domReady');
|
||||
$result = $this->Js->writeBuffer();
|
||||
$this->Js->writeBuffer();
|
||||
|
||||
unset($_SERVER['HTTP_X_REQUESTED_WITH']);
|
||||
if ($requestWith !== null) {
|
||||
|
|
|
@ -2426,7 +2426,7 @@ class PaginatorHelperTest extends CakeTestCase {
|
|||
*/
|
||||
public function testAjaxLinkGenerationNumbers() {
|
||||
$this->Paginator->Js->expectCallCount('link', 2);
|
||||
$result = $this->Paginator->numbers(array(
|
||||
$this->Paginator->numbers(array(
|
||||
'modulus' => '2',
|
||||
'url' => array('controller' => 'projects', 'action' => 'sort'),
|
||||
'update' => 'list'
|
||||
|
@ -2470,9 +2470,9 @@ class PaginatorHelperTest extends CakeTestCase {
|
|||
);
|
||||
$Paginator->PaginatorMockJs = $mock;
|
||||
$Paginator->PaginatorMockJs->expects($this->once())->method('link');
|
||||
$result = $Paginator->link('Page 2', array('page' => 2), array('update' => '#content'));
|
||||
$Paginator->link('Page 2', array('page' => 2), array('update' => '#content'));
|
||||
|
||||
$Paginator = new PaginatorHelper($this->View, array('ajax' => 'Form'));
|
||||
new PaginatorHelper($this->View, array('ajax' => 'Form'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -93,7 +93,7 @@ class HelperCollectionTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testLazyLoadException() {
|
||||
$result = $this->Helpers->NotAHelper;
|
||||
$this->Helpers->NotAHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,7 +145,7 @@ class HelperCollectionTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testLoadMissingHelper() {
|
||||
$result = $this->Helpers->load('ThisHelperShouldAlwaysBeMissing');
|
||||
$this->Helpers->load('ThisHelperShouldAlwaysBeMissing');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -364,7 +364,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
$this->Controller->constructClasses();
|
||||
|
||||
ob_start();
|
||||
$Scaffold = new Scaffold($this->Controller, $this->Controller->request);
|
||||
new Scaffold($this->Controller, $this->Controller->request);
|
||||
$this->Controller->response->send();
|
||||
$result = ob_get_clean();
|
||||
|
||||
|
@ -407,7 +407,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
$this->Controller->constructClasses();
|
||||
|
||||
ob_start();
|
||||
$Scaffold = new Scaffold($this->Controller, $this->Controller->request);
|
||||
new Scaffold($this->Controller, $this->Controller->request);
|
||||
$this->Controller->response->send();
|
||||
$result = ob_get_clean();
|
||||
|
||||
|
@ -448,7 +448,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
$this->Controller->constructClasses();
|
||||
|
||||
ob_start();
|
||||
$Scaffold = new Scaffold($this->Controller, $this->Controller->request);
|
||||
new Scaffold($this->Controller, $this->Controller->request);
|
||||
$this->Controller->response->send();
|
||||
$result = ob_get_clean();
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ class ThemeViewTest extends CakeTestCase {
|
|||
|
||||
$View = new TestTheme2View($this->Controller);
|
||||
ob_start();
|
||||
$result = $View->getViewFileName('does_not_exist');
|
||||
$View->getViewFileName('does_not_exist');
|
||||
$expected = ob_get_clean();
|
||||
$this->assertRegExp("/PagesController::/", $expected);
|
||||
$this->assertRegExp("/views(\/|\\\)themed(\/|\\\)my_theme(\/|\\\)pages(\/|\\\)does_not_exist.ctp/", $expected);
|
||||
|
@ -234,7 +234,7 @@ class ThemeViewTest extends CakeTestCase {
|
|||
|
||||
$View = new TestTheme2View($this->Controller);
|
||||
ob_start();
|
||||
$result = $View->getLayoutFileName();
|
||||
$View->getLayoutFileName();
|
||||
$expected = ob_get_clean();
|
||||
$this->assertRegExp("/Missing Layout/", $expected);
|
||||
$this->assertRegExp("/views(\/|\\\)themed(\/|\\\)my_theme(\/|\\\)layouts(\/|\\\)whatever.ctp/", $expected);
|
||||
|
|
|
@ -668,7 +668,7 @@ class ViewTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testElementInexistent() {
|
||||
$result = $this->View->element('non_existent_element');
|
||||
$this->View->element('non_existent_element');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -678,7 +678,7 @@ class ViewTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testElementInexistent2() {
|
||||
$result = $this->View->element('TestPlugin.plugin_element', array(), array('plugin' => 'test_plugin'));
|
||||
$this->View->element('TestPlugin.plugin_element', array(), array('plugin' => 'test_plugin'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -688,7 +688,7 @@ class ViewTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testElementInexistent3() {
|
||||
$result = $this->View->element('test_plugin.plugin_element');
|
||||
$this->View->element('test_plugin.plugin_element');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -733,7 +733,7 @@ class ViewTest extends CakeTestCase {
|
|||
public function testElementCacheHelperNoCache() {
|
||||
$Controller = new ViewPostsController();
|
||||
$View = new TestView($Controller);
|
||||
$helpers = $View->loadHelpers();
|
||||
$View->loadHelpers();
|
||||
$result = $View->element('test_element', array('ram' => 'val', 'test' => array('foo', 'bar')));
|
||||
$this->assertEquals('this is the test element', $result);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class CakeTestSuite extends PHPUnit_Framework_TestSuite {
|
|||
*/
|
||||
public function addTestDirectory($directory = '.') {
|
||||
$Folder = new Folder($directory);
|
||||
list($dirs, $files) = $Folder->read(true, true, true);
|
||||
list(, $files) = $Folder->read(true, true, true);
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (substr($file, -4) === '.php') {
|
||||
|
|
|
@ -156,7 +156,6 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
|||
public function handleReporter($reporter) {
|
||||
$object = null;
|
||||
|
||||
$type = strtolower($reporter);
|
||||
$reporter = ucwords($reporter);
|
||||
$coreClass = 'Cake' . $reporter . 'Reporter';
|
||||
App::uses($coreClass, 'TestSuite/Reporter');
|
||||
|
|
|
@ -239,7 +239,7 @@ class CakeTestSuiteDispatcher {
|
|||
try {
|
||||
self::time();
|
||||
$command = new CakeTestSuiteCommand('CakeTestLoader', $commandArgs);
|
||||
$result = $command->run($options);
|
||||
$command->run($options);
|
||||
} catch (MissingConnectionException $exception) {
|
||||
ob_end_clean();
|
||||
$baseDir = $this->_baseDir;
|
||||
|
|
|
@ -104,7 +104,7 @@ class CakeFixtureManager {
|
|||
* @throws UnexpectedValueException when a referenced fixture does not exist.
|
||||
*/
|
||||
protected function _loadFixtures($fixtures) {
|
||||
foreach ($fixtures as $index => $fixture) {
|
||||
foreach ($fixtures as $fixture) {
|
||||
$fixtureFile = null;
|
||||
$fixtureIndex = $fixture;
|
||||
if (isset($this->_loaded[$fixture])) {
|
||||
|
|
|
@ -199,7 +199,7 @@ class CakeTestFixture {
|
|||
|
||||
if (empty($this->fields['tableParameters']['engine'])) {
|
||||
$canUseMemory = true;
|
||||
foreach ($this->fields as $field => $args) {
|
||||
foreach ($this->fields as $args) {
|
||||
|
||||
if (is_string($args)) {
|
||||
$type = $args;
|
||||
|
|
|
@ -99,7 +99,7 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
|||
$buffer .= "<strong>EMPTY</strong>";
|
||||
}
|
||||
|
||||
foreach ($testCases as $testCaseFile => $testCase) {
|
||||
foreach ($testCases as $testCase) {
|
||||
$title = explode(DS, str_replace('.test.php', '', $testCase));
|
||||
$title[count($title) - 1] = Inflector::camelize($title[count($title) - 1]);
|
||||
$title = implode(' / ', $title);
|
||||
|
|
|
@ -164,7 +164,7 @@ class CakeTextReporter extends CakeBaseReporter {
|
|||
echo $buffer;
|
||||
}
|
||||
|
||||
foreach ($testCases as $testCaseFile => $testCase) {
|
||||
foreach ($testCases as $testCase) {
|
||||
$buffer .= $_SERVER['SERVER_NAME'] . $this->baseUrl() . "?case=" . $testCase . "&output=text\n";
|
||||
}
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ class ClassRegistry {
|
|||
}
|
||||
|
||||
if (!isset($instance)) {
|
||||
trigger_error(__d('cake_dev', '(ClassRegistry::init() could not create instance of %1$s class %2$s ', $class, $type), E_USER_WARNING);
|
||||
trigger_error(__d('cake_dev', '(ClassRegistry::init() could not create instance of %s', $class), E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,13 +227,11 @@ class String {
|
|||
|
||||
asort($data);
|
||||
|
||||
$hashKeys = array();
|
||||
foreach ($data as $key => $value) {
|
||||
$hashKeys[] = crc32($key);
|
||||
}
|
||||
|
||||
$tempData = array_combine(array_keys($data), array_values($hashKeys));
|
||||
$dataKeys = array_keys($data);
|
||||
$hashKeys = array_map('crc32', $dataKeys);
|
||||
$tempData = array_combine($dataKeys, $hashKeys);
|
||||
krsort($tempData);
|
||||
|
||||
foreach ($tempData as $key => $hashVal) {
|
||||
$key = sprintf($format, preg_quote($key, '/'));
|
||||
$str = preg_replace($key, $hashVal, $str);
|
||||
|
|
Loading…
Reference in a new issue