From 16be9d499094b1effad9ab61a80c28fa06438587 Mon Sep 17 00:00:00 2001 From: Ceeram Date: Wed, 23 Jan 2013 13:45:50 +0100 Subject: [PATCH] remove unused local vars --- lib/Cake/Console/Command/Task/TestTask.php | 4 ++-- lib/Cake/Model/Datasource/DboSource.php | 2 +- lib/Cake/Model/Model.php | 2 +- lib/Cake/Test/Case/Cache/CacheTest.php | 4 ++-- .../Test/Case/Cache/Engine/FileEngineTest.php | 2 +- .../Case/Console/Command/AclShellTest.php | 1 + .../Case/Console/Command/SchemaShellTest.php | 2 +- .../Console/Command/Task/DbConfigTaskTest.php | 2 +- .../Console/Command/Task/ExtractTaskTest.php | 2 +- .../Console/Command/Task/FixtureTaskTest.php | 2 +- .../Console/Command/Task/ModelTaskTest.php | 2 +- .../Console/Command/Task/TestTaskTest.php | 2 +- .../Case/Console/ConsoleOptionParserTest.php | 4 ++-- lib/Cake/Test/Case/Console/ShellTest.php | 11 ++++----- .../Test/Case/Console/TaskCollectionTest.php | 2 +- .../Controller/Component/Acl/DbAclTest.php | 2 +- .../Controller/Component/Acl/PhpAclTest.php | 1 - .../Controller/Component/AclComponentTest.php | 2 +- .../Component/RequestHandlerComponentTest.php | 2 +- .../Component/SecurityComponentTest.php | 4 ++-- .../Test/Case/Controller/ScaffoldTest.php | 2 +- lib/Cake/Test/Case/Core/ConfigureTest.php | 2 +- lib/Cake/Test/Case/Core/ObjectTest.php | 2 +- .../Test/Case/Error/ExceptionRendererTest.php | 2 +- lib/Cake/Test/Case/Log/CakeLogTest.php | 2 +- .../Behavior/ContainableBehaviorTest.php | 8 +++---- .../Case/Model/BehaviorCollectionTest.php | 23 +++---------------- lib/Cake/Test/Case/Model/CakeSchemaTest.php | 4 +--- .../Test/Case/Model/ConnectionManagerTest.php | 5 ++-- .../Model/Datasource/Database/MysqlTest.php | 6 ++--- .../Datasource/Database/PostgresTest.php | 1 - .../Model/Datasource/Database/SqliteTest.php | 20 ++++++++-------- .../Case/Model/Datasource/DboSourceTest.php | 9 ++++++-- .../Session/DatabaseSessionTest.php | 2 +- .../Test/Case/Model/ModelIntegrationTest.php | 2 -- lib/Cake/Test/Case/Model/ModelReadTest.php | 5 ++-- .../Test/Case/Model/ModelValidationTest.php | 2 +- lib/Cake/Test/Case/Model/ModelWriteTest.php | 10 ++------ .../Model/Validator/CakeValidationSetTest.php | 5 ---- .../Test/Case/Network/Email/CakeEmailTest.php | 7 +++--- .../Case/Network/Http/HttpResponseTest.php | 2 +- .../Test/Case/Network/Http/HttpSocketTest.php | 16 ++++++------- lib/Cake/Test/Case/Routing/DispatcherTest.php | 2 +- lib/Cake/Test/Case/Routing/RouterTest.php | 2 +- .../Case/TestSuite/ControllerTestCaseTest.php | 6 ++--- lib/Cake/Test/Case/Utility/CakeNumberTest.php | 2 +- .../Test/Case/Utility/ClassRegistryTest.php | 2 +- lib/Cake/Test/Case/Utility/DebuggerTest.php | 2 +- lib/Cake/Test/Case/Utility/FileTest.php | 2 -- .../Case/Utility/ObjectCollectionTest.php | 4 ++-- lib/Cake/Test/Case/Utility/SecurityTest.php | 12 +++++----- lib/Cake/Test/Case/Utility/XmlTest.php | 2 +- .../Test/Case/View/Helper/CacheHelperTest.php | 4 ++-- .../Test/Case/View/Helper/FormHelperTest.php | 4 ++-- .../Test/Case/View/Helper/HtmlHelperTest.php | 8 +++---- .../Test/Case/View/Helper/JsHelperTest.php | 4 ++-- .../Case/View/Helper/PaginatorHelperTest.php | 6 ++--- .../Test/Case/View/HelperCollectionTest.php | 4 ++-- lib/Cake/Test/Case/View/ScaffoldViewTest.php | 6 ++--- lib/Cake/Test/Case/View/ThemeViewTest.php | 4 ++-- lib/Cake/Test/Case/View/ViewTest.php | 8 +++---- lib/Cake/TestSuite/CakeTestSuite.php | 2 +- lib/Cake/TestSuite/CakeTestSuiteCommand.php | 1 - .../TestSuite/CakeTestSuiteDispatcher.php | 2 +- .../TestSuite/Fixture/CakeFixtureManager.php | 2 +- .../TestSuite/Fixture/CakeTestFixture.php | 2 +- .../TestSuite/Reporter/CakeHtmlReporter.php | 2 +- .../TestSuite/Reporter/CakeTextReporter.php | 2 +- lib/Cake/Utility/ClassRegistry.php | 2 +- lib/Cake/Utility/String.php | 10 ++++---- 70 files changed, 132 insertions(+), 169 deletions(-) diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php index e1da43c79..ead89df26 100644 --- a/lib/Cake/Console/Command/Task/TestTask.php +++ b/lib/Cake/Console/Command/Task/TestTask.php @@ -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}); } } diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 192f2156c..a80cc2e4c 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -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) . ' '; diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 47827af24..f5d3ea12d 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -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); } diff --git a/lib/Cake/Test/Case/Cache/CacheTest.php b/lib/Cake/Test/Case/Cache/CacheTest.php index 1c348d7e3..c76c98eec 100644 --- a/lib/Cake/Test/Case/Cache/CacheTest.php +++ b/lib/Cake/Test/Case/Cache/CacheTest.php @@ -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); } diff --git a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php index 01744caf6..248175b0b 100644 --- a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php +++ b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php @@ -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)); diff --git a/lib/Cake/Test/Case/Console/Command/AclShellTest.php b/lib/Cake/Test/Case/Console/Command/AclShellTest.php index cf98cabf5..9b56bf5e9 100644 --- a/lib/Cake/Test/Case/Console/Command/AclShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/AclShellTest.php @@ -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); diff --git a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php index 34441aa7a..a31a91788 100644 --- a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php @@ -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'); } diff --git a/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php index b831c9590..ef0860a91 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php @@ -128,6 +128,6 @@ class DbConfigTaskTest extends CakeTestCase { ) )); - $result = $this->Task->execute(); + $this->Task->execute(); } } diff --git a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php index 02b6b049f..74d7bf535 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php @@ -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); } /** diff --git a/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php index 9f2cbd0bd..73a4a7168 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php @@ -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(); } diff --git a/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php index 6f6610b81..b13efddc8 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php @@ -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'); } /** diff --git a/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php index e852fdcaf..30d31f3d9 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php @@ -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)); diff --git a/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php b/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php index 7d3a23ec1..0d14a115d 100644 --- a/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php +++ b/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php @@ -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')); } /** diff --git a/lib/Cake/Test/Case/Console/ShellTest.php b/lib/Cake/Test/Case/Console/ShellTest.php index a33f6fa10..bbc833c4d 100644 --- a/lib/Cake/Test/Case/Console/ShellTest.php +++ b/lib/Cake/Test/Case/Console/ShellTest.php @@ -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')); } /** diff --git a/lib/Cake/Test/Case/Console/TaskCollectionTest.php b/lib/Cake/Test/Case/Console/TaskCollectionTest.php index 265fe3f8d..539d01af0 100644 --- a/lib/Cake/Test/Case/Console/TaskCollectionTest.php +++ b/lib/Cake/Test/Case/Console/TaskCollectionTest.php @@ -78,7 +78,7 @@ class TaskCollectionTest extends CakeTestCase { * @return void */ public function testLoadMissingTask() { - $result = $this->Tasks->load('ThisTaskShouldAlwaysBeMissing'); + $this->Tasks->load('ThisTaskShouldAlwaysBeMissing'); } /** diff --git a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php index c0964ccb0..57419fdb7 100644 --- a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php @@ -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())); diff --git a/lib/Cake/Test/Case/Controller/Component/Acl/PhpAclTest.php b/lib/Cake/Test/Case/Controller/Component/Acl/PhpAclTest.php index 00f74bcf5..24af044f9 100644 --- a/lib/Cake/Test/Case/Controller/Component/Acl/PhpAclTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Acl/PhpAclTest.php @@ -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', diff --git a/lib/Cake/Test/Case/Controller/Component/AclComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AclComponentTest.php index b16d7af71..b95e54723 100644 --- a/lib/Cake/Test/Case/Controller/Component/AclComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AclComponentTest.php @@ -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); } /** diff --git a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php index 38b19ccb9..5e57810f7 100644 --- a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php @@ -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(); } /** diff --git a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php index 13d684a75..55dc91132 100644 --- a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php @@ -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'); } diff --git a/lib/Cake/Test/Case/Controller/ScaffoldTest.php b/lib/Cake/Test/Case/Controller/ScaffoldTest.php index 63bc445c9..d722389a6 100644 --- a/lib/Cake/Test/Case/Controller/ScaffoldTest.php +++ b/lib/Cake/Test/Case/Controller/ScaffoldTest.php @@ -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); } diff --git a/lib/Cake/Test/Case/Core/ConfigureTest.php b/lib/Cake/Test/Case/Core/ConfigureTest.php index e1d3c9f07..ffba30a08 100644 --- a/lib/Cake/Test/Case/Core/ConfigureTest.php +++ b/lib/Cake/Test/Case/Core/ConfigureTest.php @@ -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'); } /** diff --git a/lib/Cake/Test/Case/Core/ObjectTest.php b/lib/Cake/Test/Case/Core/ObjectTest.php index 5738e201c..e81cd80ce 100644 --- a/lib/Cake/Test/Case/Core/ObjectTest.php +++ b/lib/Cake/Test/Case/Core/ObjectTest.php @@ -105,7 +105,7 @@ class RequestActionController extends Controller { * @return void */ public function paginate_request_action() { - $data = $this->paginate(); + $this->paginate(); return true; } diff --git a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php index 253e7536a..91d82b40b 100644 --- a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php +++ b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php @@ -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(); } /** diff --git a/lib/Cake/Test/Case/Log/CakeLogTest.php b/lib/Cake/Test/Case/Log/CakeLogTest.php index bd402606c..292c25dba 100644 --- a/lib/Cake/Test/Case/Log/CakeLogTest.php +++ b/lib/Cake/Test/Case/Log/CakeLogTest.php @@ -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); diff --git a/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php index 40d3c37a3..0c6ad4670 100644 --- a/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php @@ -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' ), diff --git a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php index 0fc2c45a1..9bf796ea9 100644 --- a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php +++ b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php @@ -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')); diff --git a/lib/Cake/Test/Case/Model/CakeSchemaTest.php b/lib/Cake/Test/Case/Model/CakeSchemaTest.php index 7863af19a..c49b92c5c 100644 --- a/lib/Cake/Test/Case/Model/CakeSchemaTest.php +++ b/lib/Cake/Test/Case/Model/CakeSchemaTest.php @@ -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', diff --git a/lib/Cake/Test/Case/Model/ConnectionManagerTest.php b/lib/Cake/Test/Case/Model/ConnectionManagerTest.php index a35d06b20..27fe1bb23 100644 --- a/lib/Cake/Test/Case/Model/ConnectionManagerTest.php +++ b/lib/Cake/Test/Case/Model/ConnectionManagerTest.php @@ -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); } /** diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 7c4f8dcef..9561025ae 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -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', diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php index 7015750d3..324b9dcc8 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php @@ -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', diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php index 007f2a883..187b7101c 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php @@ -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); } /** diff --git a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php index 63df42417..b297bcad4 100644 --- a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php @@ -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); } /** diff --git a/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php b/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php index 2f6a2ab67..974ba054e 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php @@ -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); diff --git a/lib/Cake/Test/Case/Model/ModelIntegrationTest.php b/lib/Cake/Test/Case/Model/ModelIntegrationTest.php index 47336bcc1..3984c3234 100644 --- a/lib/Cake/Test/Case/Model/ModelIntegrationTest.php +++ b/lib/Cake/Test/Case/Model/ModelIntegrationTest.php @@ -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 diff --git a/lib/Cake/Test/Case/Model/ModelReadTest.php b/lib/Cake/Test/Case/Model/ModelReadTest.php index a91c93d52..414b726b7 100644 --- a/lib/Cake/Test/Case/Model/ModelReadTest.php +++ b/lib/Cake/Test/Case/Model/ModelReadTest.php @@ -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; diff --git a/lib/Cake/Test/Case/Model/ModelValidationTest.php b/lib/Cake/Test/Case/Model/ModelValidationTest.php index 6bddcb86e..bcd2cad2f 100644 --- a/lib/Cake/Test/Case/Model/ModelValidationTest.php +++ b/lib/Cake/Test/Case/Model/ModelValidationTest.php @@ -2139,7 +2139,7 @@ class ModelValidationTest extends BaseModelTest { * @return void */ public function testValidatorTypehintException() { - $Validator = new ModelValidator('asdasds'); + new ModelValidator('asdasds'); } /** diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index 05d9a1db4..68baa08d7 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -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(), diff --git a/lib/Cake/Test/Case/Model/Validator/CakeValidationSetTest.php b/lib/Cake/Test/Case/Model/Validator/CakeValidationSetTest.php index e2aad21a9..6c995d7a0 100644 --- a/lib/Cake/Test/Case/Model/Validator/CakeValidationSetTest.php +++ b/lib/Cake/Test/Case/Model/Validator/CakeValidationSetTest.php @@ -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); diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php index 5924374bf..44116c25e 100644 --- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php +++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php @@ -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 = '

This email was sent using the CakePHP Framework

'; $this->assertContains($expected, $this->CakeEmail->message(CakeEmail::MESSAGE_HTML)); diff --git a/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php b/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php index 495a70a8b..f8e1b3e5c 100644 --- a/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php +++ b/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php @@ -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); } /** diff --git a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php index d9d6f3ffd..ac421cce8 100644 --- a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php +++ b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php @@ -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(); diff --git a/lib/Cake/Test/Case/Routing/DispatcherTest.php b/lib/Cake/Test/Case/Routing/DispatcherTest.php index 7552671d3..fcadb2ddd 100644 --- a/lib/Cake/Test/Case/Routing/DispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/DispatcherTest.php @@ -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']); } diff --git a/lib/Cake/Test/Case/Routing/RouterTest.php b/lib/Cake/Test/Case/Routing/RouterTest.php index a3ebbdd22..acad11f4a 100644 --- a/lib/Cake/Test/Case/Routing/RouterTest.php +++ b/lib/Cake/Test/Case/Routing/RouterTest.php @@ -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'), diff --git a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php index cf6bbb85a..a9b2542f8 100644 --- a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php @@ -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); diff --git a/lib/Cake/Test/Case/Utility/CakeNumberTest.php b/lib/Cake/Test/Case/Utility/CakeNumberTest.php index 34ebcbf2e..ce4ddb339 100644 --- a/lib/Cake/Test/Case/Utility/CakeNumberTest.php +++ b/lib/Cake/Test/Case/Utility/CakeNumberTest.php @@ -636,7 +636,7 @@ class CakeNumberTest extends CakeTestCase { * @return void */ public function testFromReadableSizeException() { - $result = $this->Number->fromReadableSize('bogus', false); + $this->Number->fromReadableSize('bogus', false); } /** diff --git a/lib/Cake/Test/Case/Utility/ClassRegistryTest.php b/lib/Cake/Test/Case/Utility/ClassRegistryTest.php index eb20fcead..dc827bcd5 100644 --- a/lib/Cake/Test/Case/Utility/ClassRegistryTest.php +++ b/lib/Cake/Test/Case/Utility/ClassRegistryTest.php @@ -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')); diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php index 348459db4..dc4ad819e 100644 --- a/lib/Cake/Test/Case/Utility/DebuggerTest.php +++ b/lib/Cake/Test/Case/Utility/DebuggerTest.php @@ -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/'); } diff --git a/lib/Cake/Test/Case/Utility/FileTest.php b/lib/Cake/Test/Case/Utility/FileTest.php index 01799519d..6a2a3c3cd 100644 --- a/lib/Cake/Test/Case/Utility/FileTest.php +++ b/lib/Cake/Test/Case/Utility/FileTest.php @@ -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); diff --git a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php index ae54c0fe0..dc78984b0 100644 --- a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php +++ b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php @@ -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) diff --git a/lib/Cake/Test/Case/Utility/SecurityTest.php b/lib/Cake/Test/Case/Utility/SecurityTest.php index 5c349adf5..77ba51808 100644 --- a/lib/Cake/Test/Case/Utility/SecurityTest.php +++ b/lib/Cake/Test/Case/Utility/SecurityTest.php @@ -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'); } } diff --git a/lib/Cake/Test/Case/Utility/XmlTest.php b/lib/Cake/Test/Case/Utility/XmlTest.php index e90217d93..3748f5e9b 100644 --- a/lib/Cake/Test/Case/Utility/XmlTest.php +++ b/lib/Cake/Test/Case/Utility/XmlTest.php @@ -1020,7 +1020,7 @@ XML; XML; - $result = $obj->asXML(); + $obj->asXML(); $this->assertXmlStringEqualsXmlString($expected, $obj->asXML()); } diff --git a/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php b/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php index 8a4bd5567..ad9a4a6f3 100644 --- a/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php @@ -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)); diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index b090adcd3..8febebf10 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -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) diff --git a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php index 5a94ab636..d28e07450 100644 --- a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php @@ -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); } /** diff --git a/lib/Cake/Test/Case/View/Helper/JsHelperTest.php b/lib/Cake/Test/Case/View/Helper/JsHelperTest.php index 53b8cce97..9b5b93ad3 100644 --- a/lib/Cake/Test/Case/View/Helper/JsHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/JsHelperTest.php @@ -319,7 +319,7 @@ class JsHelperTest extends CakeTestCase { ->method('append') ->with('script', $this->matchesRegularExpression('#