From 8a8d2697d1461cac01c146f1f68dc239d464440f Mon Sep 17 00:00:00 2001 From: Mark Oberemk Date: Tue, 11 Mar 2014 10:37:47 -0400 Subject: [PATCH 01/17] Allow chaining in the addCrumb method For convenience I think it might be valuable to allow addCrumb (and possibly other similar functions) to return $this to permit chained calls such as this: $this->Html->addCrumb('Admin', '/admin')->addCrumb('Blogs', '/admin/users')->addCrumb('Add'); as opposed to the considerably more verbose version that needs to be used now: $this->Html->addCrumb('Admin', '/admin'); $this->Html->addCrumb('Blogs', '/admin/users'); $this->Html->addCrumb('Add'); I'm not sure if this violates some API conventions for helpers but it does seem rather more convenient to work with to me. --- lib/Cake/View/Helper/HtmlHelper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Cake/View/Helper/HtmlHelper.php b/lib/Cake/View/Helper/HtmlHelper.php index 6ce3cfafa..454514dc1 100644 --- a/lib/Cake/View/Helper/HtmlHelper.php +++ b/lib/Cake/View/Helper/HtmlHelper.php @@ -180,6 +180,7 @@ class HtmlHelper extends AppHelper { */ public function addCrumb($name, $link = null, $options = null) { $this->_crumbs[] = array($name, $link, $options); + return $this; } /** From 3f7eff18436c7900c563362d9218cf1351422c68 Mon Sep 17 00:00:00 2001 From: Mark Oberemk Date: Wed, 12 Mar 2014 08:59:12 -0400 Subject: [PATCH 02/17] Update HtmlHelper.php Updated documentation to include the chained $this return --- lib/Cake/View/Helper/HtmlHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/View/Helper/HtmlHelper.php b/lib/Cake/View/Helper/HtmlHelper.php index 454514dc1..edbf8e219 100644 --- a/lib/Cake/View/Helper/HtmlHelper.php +++ b/lib/Cake/View/Helper/HtmlHelper.php @@ -174,7 +174,7 @@ class HtmlHelper extends AppHelper { * @param string $name Text for link * @param string $link URL for link (if empty it won't be a link) * @param string|array $options Link attributes e.g. array('id' => 'selected') - * @return void + * @return this HtmlHelper * @see HtmlHelper::link() for details on $options that can be used. * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper */ From b93f373f1627560dc001b1e52c2941e4ce9920e4 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Mon, 31 Mar 2014 17:40:35 -0400 Subject: [PATCH 03/17] Fix yoda condition in File test --- lib/Cake/Test/Case/Utility/FileTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/Utility/FileTest.php b/lib/Cake/Test/Case/Utility/FileTest.php index 25eb1aec3..563c045b4 100644 --- a/lib/Cake/Test/Case/Utility/FileTest.php +++ b/lib/Cake/Test/Case/Utility/FileTest.php @@ -532,7 +532,7 @@ class FileTest extends CakeTestCase { $path = CAKE . 'Test' . DS . 'test_app' . DS . 'webroot' . DS . 'img' . DS . 'cake.power.gif'; $file = new File($path); $expected = 'image/gif'; - if (function_exists('mime_content_type') && false === mime_content_type($file->pwd())) { + if (function_exists('mime_content_type') && mime_content_type($file->pwd()) === false) { $expected = false; } $this->assertEquals($expected, $file->mime()); From e5dd8acb602fb8e0e16d9a812b21b877da8bdb0a Mon Sep 17 00:00:00 2001 From: Brian Porter Date: Tue, 1 Apr 2014 09:08:03 -0500 Subject: [PATCH 04/17] Adds phpunit required version to TestShell "not found" error message. --- lib/Cake/Console/Command/TestShell.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Console/Command/TestShell.php b/lib/Cake/Console/Command/TestShell.php index dd955d8a2..7e1e2b55f 100644 --- a/lib/Cake/Console/Command/TestShell.php +++ b/lib/Cake/Console/Command/TestShell.php @@ -171,7 +171,7 @@ class TestShell extends Shell { $this->_dispatcher = new CakeTestSuiteDispatcher(); $success = $this->_dispatcher->loadTestFramework(); if (!$success) { - throw new Exception(__d('cake_dev', 'Please install PHPUnit framework (http://www.phpunit.de)')); + throw new Exception(__d('cake_dev', 'Please install PHPUnit framework v3.7 (http://www.phpunit.de)')); } } From 44952b06a4799a824d039bde3b91c70df76c4625 Mon Sep 17 00:00:00 2001 From: euromark Date: Wed, 2 Apr 2014 02:23:43 +0200 Subject: [PATCH 05/17] cs --- .../Test/Case/Model/ModelValidationTest.php | 2 +- lib/Cake/Test/Case/Model/ModelWriteTest.php | 18 +++++++++--------- lib/Cake/Test/Case/Network/CakeSocketTest.php | 2 +- .../Case/Network/Http/HttpResponseTest.php | 2 +- lib/Cake/Test/Case/Utility/HashTest.php | 2 +- lib/Cake/Test/Case/Utility/XmlTest.php | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/Cake/Test/Case/Model/ModelValidationTest.php b/lib/Cake/Test/Case/Model/ModelValidationTest.php index 6369b7143..87532ae5b 100644 --- a/lib/Cake/Test/Case/Model/ModelValidationTest.php +++ b/lib/Cake/Test/Case/Model/ModelValidationTest.php @@ -2050,7 +2050,7 @@ class ModelValidationTest extends BaseModelTest { /** * testValidateFirstWithDefaults method * - * return @void + * @return void */ public function testFirstWithDefaults() { $this->loadFixtures('Article', 'Tag', 'Comment', 'User', 'ArticlesTag'); diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index 4525905a3..07b0f2e62 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -6784,7 +6784,7 @@ class ModelWriteTest extends BaseModelTest { /** * testSaveAllFieldListHasMany method * - * return @void + * @return void */ public function testSaveAllFieldListHasMany() { $this->loadFixtures('Article', 'Comment'); @@ -6971,7 +6971,7 @@ class ModelWriteTest extends BaseModelTest { /** * testSaveAllDeepFieldListHasMany method * - * return @void + * @return void */ public function testSaveAllDeepFieldListHasMany() { $this->loadFixtures('Article', 'Comment', 'User'); @@ -7014,7 +7014,7 @@ class ModelWriteTest extends BaseModelTest { /** * testSaveAllDeepHasManyBelongsTo method * - * return @void + * @return void */ public function testSaveAllDeepHasManyBelongsTo() { $this->loadFixtures('Article', 'Comment', 'User'); @@ -7066,7 +7066,7 @@ class ModelWriteTest extends BaseModelTest { /** * testSaveAllDeepHasManyhasMany method * - * return @void + * @return void */ public function testSaveAllDeepHasManyHasMany() { $this->loadFixtures('Article', 'Comment', 'User', 'Attachment'); @@ -7122,7 +7122,7 @@ class ModelWriteTest extends BaseModelTest { /** * testSaveAllDeepOrderHasManyHasMany method * - * return @void + * @return void */ public function testSaveAllDeepOrderHasManyHasMany() { $this->loadFixtures('Article', 'Comment', 'User', 'Attachment'); @@ -7159,7 +7159,7 @@ class ModelWriteTest extends BaseModelTest { /** * testSaveAllDeepEmptyHasManyHasMany method * - * return @void + * @return void */ public function testSaveAllDeepEmptyHasManyHasMany() { $this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.'); @@ -7197,7 +7197,7 @@ class ModelWriteTest extends BaseModelTest { /** * testUpdateAllBoolean * - * return @void + * @return void */ public function testUpdateAllBoolean() { $this->loadFixtures('Item', 'Syfile', 'Portfolio', 'Image', 'ItemsPortfolio'); @@ -7212,7 +7212,7 @@ class ModelWriteTest extends BaseModelTest { /** * testUpdateAllBooleanConditions * - * return @void + * @return void */ public function testUpdateAllBooleanConditions() { $this->loadFixtures('Item', 'Syfile', 'Portfolio', 'Image', 'ItemsPortfolio'); @@ -7229,7 +7229,7 @@ class ModelWriteTest extends BaseModelTest { /** * testUpdateBoolean * - * return @void + * @return void */ public function testUpdateBoolean() { $this->loadFixtures('Item', 'Syfile', 'Portfolio', 'Image', 'ItemsPortfolio'); diff --git a/lib/Cake/Test/Case/Network/CakeSocketTest.php b/lib/Cake/Test/Case/Network/CakeSocketTest.php index 56c5eecd5..c6bb2035f 100644 --- a/lib/Cake/Test/Case/Network/CakeSocketTest.php +++ b/lib/Cake/Test/Case/Network/CakeSocketTest.php @@ -118,7 +118,7 @@ class CakeSocketTest extends CakeTestCase { * * @dataProvider invalidConnections * @expectedException SocketException - * return void + * @return void */ public function testInvalidConnection($data) { $this->Socket->config = array_merge($this->Socket->config, $data); diff --git a/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php b/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php index fdc8321c1..033f12da6 100644 --- a/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php +++ b/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php @@ -355,7 +355,7 @@ class HttpResponseTest extends CakeTestCase { * * @dataProvider invalidParseResponseDataProvider * @expectedException SocketException - * return void + * @return void */ public function testInvalidParseResponseData($value) { $this->HttpResponse->parseResponse($value); diff --git a/lib/Cake/Test/Case/Utility/HashTest.php b/lib/Cake/Test/Case/Utility/HashTest.php index 9ba6f8043..c8a73ec26 100644 --- a/lib/Cake/Test/Case/Utility/HashTest.php +++ b/lib/Cake/Test/Case/Utility/HashTest.php @@ -174,7 +174,7 @@ class HashTest extends CakeTestCase { /** * Test get() * - * return void + * @return void */ public function testGet() { $data = array('abc', 'def'); diff --git a/lib/Cake/Test/Case/Utility/XmlTest.php b/lib/Cake/Test/Case/Utility/XmlTest.php index aee409d81..a8b38f9bf 100644 --- a/lib/Cake/Test/Case/Utility/XmlTest.php +++ b/lib/Cake/Test/Case/Utility/XmlTest.php @@ -206,7 +206,7 @@ class XmlTest extends CakeTestCase { /** * test build with a single empty tag * - * return void + * @return void */ public function testBuildEmptyTag() { try { From 0d09a540330433316ca1511f9631e59d175dda90 Mon Sep 17 00:00:00 2001 From: euromark Date: Wed, 2 Apr 2014 03:02:37 +0200 Subject: [PATCH 06/17] more missing doc block tags added --- .../Test/Case/Cache/Engine/FileEngineTest.php | 2 + .../Console/Command/Task/TestTaskTest.php | 2 + .../Case/Console/ConsoleOptionParserTest.php | 2 + lib/Cake/Test/Case/Console/ShellTest.php | 4 ++ .../Controller/Component/Acl/PhpAclTest.php | 29 +++++++++++- .../Auth/ControllerAuthorizeTest.php | 3 ++ .../Component/CookieComponentTest.php | 2 + .../Component/EmailComponentTest.php | 2 + .../Component/PaginatorComponentTest.php | 1 + .../Component/SecurityComponentTest.php | 3 +- .../Test/Case/Controller/ScaffoldTest.php | 4 +- lib/Cake/Test/Case/Core/AppTest.php | 3 ++ lib/Cake/Test/Case/Core/ConfigureTest.php | 1 + .../Test/Case/Error/ExceptionRendererTest.php | 2 + lib/Cake/Test/Case/Log/CakeLogTest.php | 20 ++++++++ .../Test/Case/Log/Engine/ConsoleLogTest.php | 6 +++ .../Case/Model/Behavior/AclBehaviorTest.php | 2 + .../Behavior/ContainableBehaviorTest.php | 8 ++++ .../Model/Behavior/TranslateBehaviorTest.php | 2 + .../Case/Model/BehaviorCollectionTest.php | 5 ++ .../Model/Datasource/Database/MysqlTest.php | 3 ++ .../Datasource/Database/PostgresTest.php | 3 ++ .../Model/Datasource/Database/SqliteTest.php | 4 ++ .../Datasource/Database/SqlserverTest.php | 1 + .../Case/Model/Datasource/DboSourceTest.php | 2 + .../Test/Case/Model/ModelIntegrationTest.php | 6 +++ lib/Cake/Test/Case/Model/ModelReadTest.php | 1 + lib/Cake/Test/Case/Model/ModelWriteTest.php | 4 ++ lib/Cake/Test/Case/Model/models.php | 14 ++++++ .../Test/Case/Network/CakeRequestTest.php | 3 ++ .../Test/Case/Network/CakeResponseTest.php | 18 ++++++++ .../Test/Case/Network/Email/CakeEmailTest.php | 46 +++++++++++++++++-- lib/Cake/Test/Case/Routing/DispatcherTest.php | 2 + lib/Cake/Test/Case/Routing/RouterTest.php | 4 ++ .../Test/Case/TestSuite/CakeTestCaseTest.php | 5 ++ .../Case/TestSuite/ControllerTestCaseTest.php | 19 ++++++++ .../Test/Case/Utility/ClassRegistryTest.php | 2 + lib/Cake/Test/Case/Utility/DebuggerTest.php | 2 + lib/Cake/Test/Case/Utility/FileTest.php | 5 +- lib/Cake/Test/Case/Utility/HashTest.php | 2 + .../Case/Utility/ObjectCollectionTest.php | 8 ++++ lib/Cake/Test/Case/Utility/SetTest.php | 2 + lib/Cake/Test/Case/Utility/XmlTest.php | 2 + .../Test/Case/View/Helper/FormHelperTest.php | 2 + .../Test/Case/View/Helper/HtmlHelperTest.php | 7 ++- .../Case/View/Helper/NumberHelperTest.php | 4 ++ .../Test/Case/View/Helper/TextHelperTest.php | 4 ++ .../Test/Case/View/Helper/TimeHelperTest.php | 4 ++ lib/Cake/Test/Case/View/ViewTest.php | 2 + 49 files changed, 275 insertions(+), 9 deletions(-) diff --git a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php index 845dfb86a..cfd4ae916 100644 --- a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php +++ b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php @@ -453,6 +453,8 @@ class FileEngineTest extends CakeTestCase { /** * Test that clearing with repeat writes works properly + * + * @return void */ public function testClearingWithRepeatWrites() { Cache::config('repeat', array( diff --git a/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php index 07982c22d..351f45a21 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php @@ -532,6 +532,8 @@ class TestTaskTest extends CakeTestCase { /** * Test generateUses() + * + * @return void */ public function testGenerateUses() { $result = $this->Task->generateUses('model', 'Model', 'Post'); diff --git a/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php b/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php index 47153d555..eabfbdd1c 100644 --- a/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php +++ b/lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php @@ -258,6 +258,7 @@ class ConsoleOptionParserTest extends CakeTestCase { * test parsing options that do not exist. * * @expectedException ConsoleException + * @return void */ public function testOptionThatDoesNotExist() { $parser = new ConsoleOptionParser('test', false); @@ -270,6 +271,7 @@ class ConsoleOptionParserTest extends CakeTestCase { * test parsing short options that do not exist. * * @expectedException ConsoleException + * @return void */ public function testShortOptionThatDoesNotExist() { $parser = new ConsoleOptionParser('test', false); diff --git a/lib/Cake/Test/Case/Console/ShellTest.php b/lib/Cake/Test/Case/Console/ShellTest.php index 74f50e771..b25b087b0 100644 --- a/lib/Cake/Test/Case/Console/ShellTest.php +++ b/lib/Cake/Test/Case/Console/ShellTest.php @@ -840,6 +840,8 @@ TEXT; /** * Test file and console and logging + * + * @return void */ public function testFileAndConsoleLogging() { // file logging @@ -886,6 +888,8 @@ TEXT; /** * Test file and console and logging quiet output + * + * @return void */ public function testQuietLog() { $output = $this->getMock('ConsoleOutput', array(), array(), '', false); diff --git a/lib/Cake/Test/Case/Controller/Component/Acl/PhpAclTest.php b/lib/Cake/Test/Case/Controller/Component/Acl/PhpAclTest.php index 169f015f5..d427fbb4c 100644 --- a/lib/Cake/Test/Case/Controller/Component/Acl/PhpAclTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Acl/PhpAclTest.php @@ -29,6 +29,8 @@ class PhpAclTest extends CakeTestCase { /** * Setup + * + * @return void */ public function setUp() { parent::setUp(); @@ -44,6 +46,8 @@ class PhpAclTest extends CakeTestCase { /** * Test role inheritance + * + * @return void */ public function testRoleInheritance() { $roles = $this->Acl->Aro->roles('User/peter'); @@ -58,7 +62,9 @@ class PhpAclTest extends CakeTestCase { } /** - * Tst adding a role + * Test adding a role + * + * @return void */ public function testAddRole() { $this->assertEquals(array(array(PhpAro::DEFAULT_ROLE)), $this->Acl->Aro->roles('foobar')); @@ -68,6 +74,8 @@ class PhpAclTest extends CakeTestCase { /** * Test resolving ARO + * + * @return void */ public function testAroResolve() { $this->Acl->Aro->map = array( @@ -92,6 +100,8 @@ class PhpAclTest extends CakeTestCase { /** * test correct resolution of defined aliases + * + * @return void */ public function testAroAliases() { $this->Acl->Aro->map = array( @@ -193,6 +203,8 @@ class PhpAclTest extends CakeTestCase { /** * lhs of defined rules are case insensitive + * + * @return void */ public function testCheckIsCaseInsensitive() { $this->assertTrue($this->Acl->check('hardy', 'controllers/forms/new')); @@ -203,6 +215,8 @@ class PhpAclTest extends CakeTestCase { /** * allow should work in-memory + * + * @return void */ public function testAllow() { $this->assertFalse($this->Acl->check('jeff', 'foo/bar')); @@ -223,6 +237,8 @@ class PhpAclTest extends CakeTestCase { /** * deny should work in-memory + * + * @return void */ public function testDeny() { $this->assertTrue($this->Acl->check('stan', 'controllers/baz/manager_foo')); @@ -237,6 +253,8 @@ class PhpAclTest extends CakeTestCase { /** * test that a deny rule wins over an equally specific allow rule + * + * @return void */ public function testDenyRuleIsStrongerThanAllowRule() { $this->assertFalse($this->Acl->check('peter', 'baz/bam')); @@ -261,6 +279,8 @@ class PhpAclTest extends CakeTestCase { /** * test that an invalid configuration throws exception + * + * @return void */ public function testInvalidConfigWithAroMissing() { $this->setExpectedException( @@ -286,6 +306,8 @@ class PhpAclTest extends CakeTestCase { /** * test resolving of ACOs + * + * @return void */ public function testAcoResolve() { $this->assertEquals(array('foo', 'bar'), $this->Acl->Aco->resolve('foo/bar')); @@ -305,6 +327,8 @@ class PhpAclTest extends CakeTestCase { /** * test that declaring cyclic dependencies should give an error when building the tree + * + * @return void */ public function testAroDeclarationContainsCycles() { $config = array( @@ -328,6 +352,8 @@ class PhpAclTest extends CakeTestCase { /** * test that with policy allow, only denies count + * + * @return void */ public function testPolicy() { // allow by default @@ -344,4 +370,5 @@ class PhpAclTest extends CakeTestCase { $this->assertFalse($this->Acl->check('Role/sales', 'controllers/bar/delete')); $this->assertFalse($this->Acl->check('Role/sales', 'controllers/bar', 'delete')); } + } diff --git a/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php b/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php index 8b1f63b2f..8c57c6e76 100644 --- a/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Auth/ControllerAuthorizeTest.php @@ -46,6 +46,7 @@ class ControllerAuthorizeTest extends CakeTestCase { /** * @expectedException PHPUnit_Framework_Error + * @return void */ public function testControllerTypeError() { $this->auth->controller(new StdClass()); @@ -53,6 +54,7 @@ class ControllerAuthorizeTest extends CakeTestCase { /** * @expectedException CakeException + * @return void */ public function testControllerErrorOnMissingMethod() { $this->auth->controller(new Controller()); @@ -85,4 +87,5 @@ class ControllerAuthorizeTest extends CakeTestCase { $this->assertTrue($this->auth->authorize($user, $request)); } + } diff --git a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php index 25f165c27..972721f51 100644 --- a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php @@ -594,6 +594,8 @@ class CookieComponentTest extends CakeTestCase { /** * Test reading empty values. + * + * @return void */ public function testReadEmpty() { $_COOKIE['CakeTestCookie'] = array( diff --git a/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php b/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php index ca46224c4..ef541f34f 100644 --- a/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php @@ -863,6 +863,8 @@ HTMLBLOC; /** * Make sure from/to are not double encoded when UTF-8 is present + * + * @return void */ public function testEncodingFrom() { $this->Controller->EmailTest->to = 'Teßt '; diff --git a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php index 5e99ed2a0..74d17cbf3 100644 --- a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php @@ -677,6 +677,7 @@ class PaginatorComponentTest extends CakeTestCase { * Tests for missing models * * @expectedException MissingModelException + * @return void */ public function testPaginateMissingModel() { $Controller = new PaginatorTestController($this->request); diff --git a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php index 16ac972b4..455758a60 100644 --- a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php @@ -172,6 +172,7 @@ class SecurityComponentTest extends CakeTestCase { * visibility keyword in the blackhole callback * * @expectedException BadRequestException + * @return void */ public function testBlackholeWithBrokenCallback() { $request = new CakeRequest('posts/index', false); @@ -830,7 +831,7 @@ class SecurityComponentTest extends CakeTestCase { /** * Test that validatePost fails when unlocked fields are changed. * - * @return + * @return void */ public function testValidatePostFailDisabledFieldTampering() { $this->Controller->Security->startup($this->Controller); diff --git a/lib/Cake/Test/Case/Controller/ScaffoldTest.php b/lib/Cake/Test/Case/Controller/ScaffoldTest.php index d1810aa6d..5381b074b 100644 --- a/lib/Cake/Test/Case/Controller/ScaffoldTest.php +++ b/lib/Cake/Test/Case/Controller/ScaffoldTest.php @@ -64,6 +64,7 @@ class ScaffoldMockControllerWithFields extends Controller { * function beforeScaffold * * @param string method + * @return boolean true */ public function beforeScaffold($method) { $this->set('scaffoldFields', array('title')); @@ -82,7 +83,8 @@ class TestScaffoldMock extends Scaffold { /** * Overload _scaffold * - * @param unknown_type $params + * @param CakeRequest $request + * @return void */ protected function _scaffold(CakeRequest $request) { $this->_params = $request; diff --git a/lib/Cake/Test/Case/Core/AppTest.php b/lib/Cake/Test/Case/Core/AppTest.php index 5ad5e8f9b..24419edfc 100644 --- a/lib/Cake/Test/Case/Core/AppTest.php +++ b/lib/Cake/Test/Case/Core/AppTest.php @@ -362,6 +362,8 @@ class AppTest extends CakeTestCase { /** * Make sure that .svn and friends are excluded from App::objects('plugin') + * + * @return void */ public function testListObjectsIgnoreDotDirectories() { $path = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS; @@ -793,6 +795,7 @@ class AppTest extends CakeTestCase { * Tests that the automatic class loader will also find in "libs" folder for both * app and plugins if it does not find the class in other configured paths * + * @return void */ public function testLoadClassInLibs() { App::build(array( diff --git a/lib/Cake/Test/Case/Core/ConfigureTest.php b/lib/Cake/Test/Case/Core/ConfigureTest.php index 9fb0705d8..f91218418 100644 --- a/lib/Cake/Test/Case/Core/ConfigureTest.php +++ b/lib/Cake/Test/Case/Core/ConfigureTest.php @@ -436,6 +436,7 @@ class ConfigureTest extends CakeTestCase { /** * @expectedException ConfigureException + * @return void */ public function testDumpNoAdapter() { Configure::dump(TMP . 'test.php', 'does_not_exist'); diff --git a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php index a6a904aaf..d24bbb55c 100644 --- a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php +++ b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php @@ -270,6 +270,8 @@ class ExceptionRendererTest extends CakeTestCase { /** * test that helpers in custom CakeErrorController are not lost + * + * @return void */ public function testCakeErrorHelpersNotLost() { $testApp = CAKE . 'Test' . DS . 'test_app' . DS; diff --git a/lib/Cake/Test/Case/Log/CakeLogTest.php b/lib/Cake/Test/Case/Log/CakeLogTest.php index 0dbbd2269..5ca5f2741 100644 --- a/lib/Cake/Test/Case/Log/CakeLogTest.php +++ b/lib/Cake/Test/Case/Log/CakeLogTest.php @@ -260,6 +260,7 @@ class CakeLogTest extends CakeTestCase { * test enable * * @expectedException CakeLogException + * @return void */ public function testStreamEnable() { CakeLog::config('spam', array( @@ -275,6 +276,7 @@ class CakeLogTest extends CakeTestCase { * test disable * * @expectedException CakeLogException + * @return void */ public function testStreamDisable() { CakeLog::config('spam', array( @@ -292,6 +294,7 @@ class CakeLogTest extends CakeTestCase { * test enabled() invalid stream * * @expectedException CakeLogException + * @return void */ public function testStreamEnabledInvalid() { CakeLog::enabled('bogus_stream'); @@ -301,11 +304,17 @@ class CakeLogTest extends CakeTestCase { * test disable invalid stream * * @expectedException CakeLogException + * @return void */ public function testStreamDisableInvalid() { CakeLog::disable('bogus_stream'); } +/** + * resets log config + * + * @return void + */ protected function _resetLogConfig() { CakeLog::config('debug', array( 'engine' => 'File', @@ -319,6 +328,11 @@ class CakeLogTest extends CakeTestCase { )); } +/** + * delete logs + * + * @return void + */ protected function _deleteLogs() { if (file_exists(LOGS . 'shops.log')) { unlink(LOGS . 'shops.log'); @@ -568,6 +582,8 @@ class CakeLogTest extends CakeTestCase { /** * test convenience methods + * + * @return void */ public function testConvenienceMethods() { $this->_deleteLogs(); @@ -642,6 +658,8 @@ class CakeLogTest extends CakeTestCase { /** * test levels customization + * + * @return void */ public function testLevelCustomization() { $this->skipIf(DIRECTORY_SEPARATOR === '\\', 'Log level tests not supported on Windows.'); @@ -672,6 +690,8 @@ class CakeLogTest extends CakeTestCase { /** * Test writing log files with custom levels + * + * @return void */ public function testCustomLevelWrites() { $this->_deleteLogs(); diff --git a/lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php b/lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php index 71ab3d8db..ea67a4058 100644 --- a/lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php +++ b/lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php @@ -73,6 +73,8 @@ class ConsoleLogTest extends CakeTestCase { /** * Test writing to ConsoleOutput + * + * @return void */ public function testConsoleOutputWrites() { TestCakeLog::config('test_console_log', array( @@ -92,6 +94,8 @@ class ConsoleLogTest extends CakeTestCase { /** * Test logging to both ConsoleLog and FileLog + * + * @return void */ public function testCombinedLogWriting() { TestCakeLog::config('test_console_log', array( @@ -128,6 +132,8 @@ class ConsoleLogTest extends CakeTestCase { /** * test default value of stream 'outputAs' + * + * @return void */ public function testDefaultOutputAs() { TestCakeLog::config('test_console_log', array( diff --git a/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php index c99be9350..0dc17b5bb 100644 --- a/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php @@ -122,6 +122,7 @@ class AclUser extends CakeTestModel { /** * parentNode * + * @return null */ public function parentNode() { return null; @@ -160,6 +161,7 @@ class AclPost extends CakeTestModel { /** * parentNode * + * @return null */ public function parentNode() { return null; diff --git a/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php index 801b159c0..bdd209ee6 100644 --- a/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php @@ -43,6 +43,7 @@ class ContainableBehaviorTest extends CakeTestCase { /** * Method executed before each test * + * @return void */ public function setUp() { parent::setUp(); @@ -68,6 +69,7 @@ class ContainableBehaviorTest extends CakeTestCase { /** * Method executed after each test * + * @return void */ public function tearDown() { unset($this->Article); @@ -3388,6 +3390,7 @@ class ContainableBehaviorTest extends CakeTestCase { /** * testResetAddedAssociation method * + * @return void */ public function testResetAddedAssociation() { $this->assertTrue(empty($this->Article->hasMany['ArticlesTag'])); @@ -3429,6 +3432,7 @@ class ContainableBehaviorTest extends CakeTestCase { /** * testResetAssociation method * + * @return void */ public function testResetAssociation() { $this->Article->Behaviors->load('Containable'); @@ -3460,6 +3464,7 @@ class ContainableBehaviorTest extends CakeTestCase { /** * testResetDeeperHasOneAssociations method * + * @return void */ public function testResetDeeperHasOneAssociations() { $this->Article->User->unbindModel(array( @@ -3520,6 +3525,7 @@ class ContainableBehaviorTest extends CakeTestCase { /** * testResetMultipleHabtmAssociations method * + * @return void */ public function testResetMultipleHabtmAssociations() { $articleHabtm = array( @@ -3610,6 +3616,8 @@ class ContainableBehaviorTest extends CakeTestCase { /** * test that bindModel and unbindModel work with find() calls in between. + * + * @return void */ public function testBindMultipleTimesWithFind() { $binding = array( diff --git a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php index ba584402e..1dcf5d58a 100644 --- a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php @@ -416,6 +416,8 @@ class TranslateBehaviorTest extends CakeTestCase { /** * Test loading fields with 0 as the translated value. + * + * @return void */ public function testFetchTranslationsWithZero() { $this->loadFixtures('Translate', 'TranslatedItem'); diff --git a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php index d4dea6814..8439be0b0 100644 --- a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php +++ b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php @@ -476,6 +476,7 @@ class BehaviorCollectionTest extends CakeTestCase { /** * Test load() with enabled => false * + * @return void */ public function testLoadDisabled() { $Apple = new Apple(); @@ -488,6 +489,8 @@ class BehaviorCollectionTest extends CakeTestCase { /** * Tests loading aliased behaviors + * + * @return void */ public function testLoadAlias() { $Apple = new Apple(); @@ -1189,6 +1192,8 @@ class BehaviorCollectionTest extends CakeTestCase { /** * Test that behavior priority + * + * @return void */ public function testBehaviorOrderCallbacks() { $model = ClassRegistry::init('Orangutan'); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 106ace594..0a3adc581 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -58,6 +58,7 @@ class MysqlTest extends CakeTestCase { /** * Sets up a Dbo class instance for testing * + * @return void */ public function setUp() { parent::setUp(); @@ -73,6 +74,7 @@ class MysqlTest extends CakeTestCase { /** * Sets up a Dbo class instance for testing * + * @return void */ public function tearDown() { parent::tearDown(); @@ -85,6 +87,7 @@ class MysqlTest extends CakeTestCase { * Test Dbo value method * * @group quoting + * @return void */ public function testQuoting() { $result = $this->Dbo->fields($this->model); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php index 18b981b6a..c1799c072 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php @@ -211,6 +211,7 @@ class PostgresTest extends CakeTestCase { /** * Sets up a Dbo class instance for testing * + * @return void */ public function setUp() { parent::setUp(); @@ -224,6 +225,7 @@ class PostgresTest extends CakeTestCase { /** * Sets up a Dbo class instance for testing * + * @return void */ public function tearDown() { parent::tearDown(); @@ -234,6 +236,7 @@ class PostgresTest extends CakeTestCase { /** * Test field quoting method * + * @return void */ public function testFieldQuoting() { $fields = array( diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php index d1a515aa2..988e87577 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php @@ -89,6 +89,7 @@ class SqliteTest extends CakeTestCase { /** * Sets up a Dbo class instance for testing * + * @return void */ public function setUp() { parent::setUp(); @@ -102,6 +103,7 @@ class SqliteTest extends CakeTestCase { /** * Sets up a Dbo class instance for testing * + * @return void */ public function tearDown() { parent::tearDown(); @@ -111,6 +113,7 @@ class SqliteTest extends CakeTestCase { /** * Tests that SELECT queries from DboSqlite::listSources() are not cached * + * @return void */ public function testTableListCacheDisabling() { $this->assertFalse(in_array('foo_test', $this->Dbo->listSources())); @@ -157,6 +160,7 @@ class SqliteTest extends CakeTestCase { /** * Tests that cached table descriptions are saved under the sanitized key name * + * @return void */ public function testCacheKeyName() { Configure::write('Cache.disable', false); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php index ed82ad50d..a63f1a982 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php @@ -262,6 +262,7 @@ class SqlserverTest extends CakeTestCase { /** * Sets up a Dbo class instance for testing * + * @return void */ public function setUp() { parent::setUp(); diff --git a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php index 075268407..a97e29d15 100644 --- a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php @@ -998,6 +998,8 @@ class DboSourceTest extends CakeTestCase { /** * Test getting the last error. + * + * @return void */ public function testLastError() { $stmt = $this->getMock('PDOStatement'); diff --git a/lib/Cake/Test/Case/Model/ModelIntegrationTest.php b/lib/Cake/Test/Case/Model/ModelIntegrationTest.php index a5f0e7969..e7f53183a 100644 --- a/lib/Cake/Test/Case/Model/ModelIntegrationTest.php +++ b/lib/Cake/Test/Case/Model/ModelIntegrationTest.php @@ -29,6 +29,8 @@ class DboMock extends DboSource { /** * Returns the $field without modifications + * + * @return string */ public function name($field) { return $field; @@ -36,6 +38,8 @@ class DboMock extends DboSource { /** * Returns true to fake a database connection + * + * @return boolean true */ public function connect() { return true; @@ -277,6 +281,8 @@ class ModelIntegrationTest extends BaseModelTest { * Tests cross database joins. Requires $test and $test2 to both be set in DATABASE_CONFIG * NOTE: When testing on MySQL, you must set 'persistent' => false on *both* database connections, * or one connection will step on the other. + * + * @return void */ public function testCrossDatabaseJoins() { $config = ConnectionManager::enumConnectionObjects(); diff --git a/lib/Cake/Test/Case/Model/ModelReadTest.php b/lib/Cake/Test/Case/Model/ModelReadTest.php index 97cd6876c..fc0d795be 100644 --- a/lib/Cake/Test/Case/Model/ModelReadTest.php +++ b/lib/Cake/Test/Case/Model/ModelReadTest.php @@ -7836,6 +7836,7 @@ class ModelReadTest extends BaseModelTest { * Test correct fetching of virtual fields * currently is not possible to do Relation.virtualField * + * @return void */ public function testVirtualFieldsMysql() { $this->skipIf(!($this->db instanceof Mysql), 'The rest of virtualFields test only compatible with Mysql.'); diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index 07b0f2e62..6acfd3c51 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -40,6 +40,7 @@ class TestAuthor extends Author { * Helper method to set a datasource object * * @param Object $object The datasource object + * @return void */ public function setDataSourceObject($object) { $this->_dataSourceObject = $object; @@ -77,6 +78,7 @@ class TestPost extends Post { * Helper method to set a datasource object * * @param Object $object The datasource object + * @return void */ public function setDataSourceObject($object) { $this->_dataSourceObject = $object; @@ -365,6 +367,8 @@ class ModelWriteTest extends BaseModelTest { /** * test that save() resets whitelist on failed save + * + * @return void */ public function testSaveFieldListResetsWhitelistOnFailedSave() { $this->loadFixtures('Bidding'); diff --git a/lib/Cake/Test/Case/Model/models.php b/lib/Cake/Test/Case/Model/models.php index d1cf7de8d..3e4497246 100644 --- a/lib/Cake/Test/Case/Model/models.php +++ b/lib/Cake/Test/Case/Model/models.php @@ -929,6 +929,10 @@ class Post extends CakeTestModel { */ public $belongsTo = array('Author'); +/** + * @param array $queryData + * @return boolean true + */ public function beforeFind($queryData) { if (isset($queryData['connection'])) { $this->useDbConfig = $queryData['connection']; @@ -936,6 +940,11 @@ class Post extends CakeTestModel { return true; } +/** + * @param array $results + * @param boolean $primary + * @return array $results + */ public function afterFind($results, $primary = false) { $this->useDbConfig = 'test'; return $results; @@ -2729,6 +2738,11 @@ class AfterTree extends NumberTree { */ public $actsAs = array('Tree'); +/** + * @param boolean $created + * @param array $options + * @return void + */ public function afterSave($created, $options = array()) { if ($created && isset($this->data['AfterTree'])) { $this->data['AfterTree']['name'] = 'Six and One Half Changed in AfterTree::afterSave() but not in database'; diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index 43c6a3120..25c34770d 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -612,6 +612,8 @@ class CakeRequestTest extends CakeTestCase { /** * Test that files in the 0th index work. + * + * @return void */ public function testFilesZeroithIndex() { $_FILES = array( @@ -1296,6 +1298,7 @@ class CakeRequestTest extends CakeTestCase { * - index.php/bananas/eat/tasty_banana * * @link https://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/3318 + * @return void */ public function testBaseUrlWithModRewriteAndIndexPhp() { $_SERVER['REQUEST_URI'] = '/cakephp/app/webroot/index.php'; diff --git a/lib/Cake/Test/Case/Network/CakeResponseTest.php b/lib/Cake/Test/Case/Network/CakeResponseTest.php index 53b1fbd9f..16326ea4d 100644 --- a/lib/Cake/Test/Case/Network/CakeResponseTest.php +++ b/lib/Cake/Test/Case/Network/CakeResponseTest.php @@ -47,6 +47,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the request object constructor * + * @return void */ public function testConstruct() { $response = new CakeResponse(); @@ -71,6 +72,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the body method * + * @return void */ public function testBody() { $response = new CakeResponse(); @@ -83,6 +85,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the charset method * + * @return void */ public function testCharset() { $response = new CakeResponse(); @@ -96,6 +99,7 @@ class CakeResponseTest extends CakeTestCase { * Tests the statusCode method * * @expectedException CakeException + * @return void */ public function testStatusCode() { $response = new CakeResponse(); @@ -111,6 +115,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the type method * + * @return void */ public function testType() { $response = new CakeResponse(); @@ -133,6 +138,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the header method * + * @return void */ public function testHeader() { $response = new CakeResponse(); @@ -181,6 +187,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the send method * + * @return void */ public function testSend() { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', '_setCookies')); @@ -226,7 +233,9 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the send method and changing the content type + * * @dataProvider charsetTypeProvider + * @return void */ public function testSendChangingContentType($original, $expected) { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', '_setCookies')); @@ -246,6 +255,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the send method and changing the content type to JS without adding the charset * + * @return void */ public function testSendChangingContentTypeWithoutCharset() { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', '_setCookies')); @@ -267,6 +277,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the send method and changing the content type * + * @return void */ public function testSendWithLocation() { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', '_setCookies')); @@ -284,6 +295,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the disableCache method * + * @return void */ public function testDisableCache() { $response = new CakeResponse(); @@ -299,6 +311,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the cache method * + * @return void */ public function testCache() { $response = new CakeResponse(); @@ -371,6 +384,7 @@ class CakeResponseTest extends CakeTestCase { * Tests the httpCodes method * * @expectedException CakeException + * @return void */ public function testHttpCodes() { $response = new CakeResponse(); @@ -415,6 +429,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the download method * + * @return void */ public function testDownload() { $response = new CakeResponse(); @@ -428,6 +443,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the mapType method * + * @return void */ public function testMapType() { $response = new CakeResponse(); @@ -444,6 +460,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the outputCompressed method * + * @return void */ public function testOutputCompressed() { $response = new CakeResponse(); @@ -481,6 +498,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the send and setting of Content-Length * + * @return void */ public function testSendContentLength() { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php index 2279b324d..5b0fdf6ed 100644 --- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php +++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php @@ -42,6 +42,7 @@ class TestCakeEmail extends CakeEmail { /** * Wrap to protected method * + * @return array */ public function formatAddress($address) { return parent::_formatAddress($address); @@ -50,6 +51,7 @@ class TestCakeEmail extends CakeEmail { /** * Wrap to protected method * + * @return array */ public function wrap($text, $length = CakeEmail::LINE_LENGTH_MUST) { return parent::_wrap($text, $length); @@ -67,6 +69,7 @@ class TestCakeEmail extends CakeEmail { /** * Encode to protected method * + * @return string */ public function encode($text) { return $this->_encode($text); @@ -75,6 +78,7 @@ class TestCakeEmail extends CakeEmail { /** * Render to protected method * + * @return array */ public function render($content) { return $this->_render($content); @@ -82,7 +86,7 @@ class TestCakeEmail extends CakeEmail { } -/* +/** * EmailConfig class * */ @@ -91,7 +95,7 @@ class TestEmailConfig { /** * test config * - * @var string + * @var array */ public $test = array( 'from' => array('some@example.com' => 'My website'), @@ -105,7 +109,7 @@ class TestEmailConfig { /** * test config 2 * - * @var string + * @var array */ public $test2 = array( 'from' => array('some@example.com' => 'My website'), @@ -118,7 +122,7 @@ class TestEmailConfig { } -/* +/** * ExtendTransport class * test class to ensure the class has send() method * @@ -336,6 +340,8 @@ class CakeEmailTest extends CakeTestCase { /** * Tests that it is possible set custom email validation + * + * @return void */ public function testCustomEmailValidation() { $regex = '/^[\.a-z0-9!#$%&\'*+\/=?^_`{|}~-]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]{2,6}$/i'; @@ -2051,6 +2057,8 @@ class CakeEmailTest extends CakeTestCase { * Tests for compatible check. * charset property and charset() method. * headerCharset property and headerCharset() method. + * + * @return void */ public function testCharsetsCompatible() { $this->skipIf(!function_exists('mb_convert_encoding')); @@ -2102,6 +2110,11 @@ class CakeEmailTest extends CakeTestCase { $this->assertSame($oldStyleHeaders['Subject'], $newStyleHeaders['Subject']); } +/** + * @param mixed $charset + * @param mixed $headerCharset + * @return CakeEmail + */ protected function _getEmailByOldStyleCharset($charset, $headerCharset) { $email = new CakeEmail(array('transport' => 'Debug')); @@ -2121,6 +2134,11 @@ class CakeEmailTest extends CakeTestCase { return $email; } +/** + * @param mixed $charset + * @param mixed $headerCharset + * @return CakeEmail + */ protected function _getEmailByNewStyleCharset($charset, $headerCharset) { $email = new CakeEmail(array('transport' => 'Debug')); @@ -2140,6 +2158,11 @@ class CakeEmailTest extends CakeTestCase { return $email; } +/** + * testWrapLongLine() + * + * @return void + */ public function testWrapLongLine() { $message = '' . str_repeat('x', CakeEmail::LINE_LENGTH_MUST) . ""; @@ -2180,6 +2203,11 @@ class CakeEmailTest extends CakeTestCase { $this->assertLineLengths($result['message']); } +/** + * testWrapWithTagsAcrossLines() + * + * @return void + */ public function testWrapWithTagsAcrossLines() { $str = << @@ -2204,6 +2232,11 @@ HTML; $this->assertLineLengths($result['message']); } +/** + * CakeEmailTest::testWrapIncludeLessThanSign() + * + * @return void + */ public function testWrapIncludeLessThanSign() { $str = 'fooassertLineLengths($result['message']); } +/** + * CakeEmailTest::testWrapForJapaneseEncoding() + * + * @return void + */ public function testWrapForJapaneseEncoding() { $this->skipIf(!function_exists('mb_convert_encoding')); diff --git a/lib/Cake/Test/Case/Routing/DispatcherTest.php b/lib/Cake/Test/Case/Routing/DispatcherTest.php index 794f405aa..b2be960b7 100644 --- a/lib/Cake/Test/Case/Routing/DispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/DispatcherTest.php @@ -462,6 +462,8 @@ class TestCachedPagesController extends Controller { /** * Test cached views with themes. + * + * @return void */ public function themed() { $this->cacheAction = 10; diff --git a/lib/Cake/Test/Case/Routing/RouterTest.php b/lib/Cake/Test/Case/Routing/RouterTest.php index 2cdc6ed6e..fbd5fb6ab 100644 --- a/lib/Cake/Test/Case/Routing/RouterTest.php +++ b/lib/Cake/Test/Case/Routing/RouterTest.php @@ -2388,6 +2388,8 @@ class RouterTest extends CakeTestCase { /** * test using custom route class in PluginDot notation + * + * @return void */ public function testUsingCustomRouteClassPluginDotSyntax() { App::build(array( @@ -2550,6 +2552,8 @@ class RouterTest extends CakeTestCase { /** * Test that Router::url() uses the first request + * + * @return void */ public function testUrlWithRequestAction() { $firstRequest = new CakeRequest('/posts/index'); diff --git a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php index 2d884b246..3dfc66926 100644 --- a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php @@ -35,6 +35,11 @@ class CakeTestCaseTest extends CakeTestCase { */ public $fixtures = array('core.post', 'core.author', 'core.test_plugin_comment'); +/** + * CakeTestCaseTest::setUpBeforeClass() + * + * @return void + */ public static function setUpBeforeClass() { require_once CAKE . 'Test' . DS . 'Fixture' . DS . 'AssertTagsTestCase.php'; require_once CAKE . 'Test' . DS . 'Fixture' . DS . 'FixturizedTestCase.php'; diff --git a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php index 206b66f11..4eb1d3011 100644 --- a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php @@ -145,6 +145,8 @@ class ControllerTestCaseTest extends CakeTestCase { /** * Test that ControllerTestCase::generate() creates mock objects correctly + * + * @return void */ public function testGenerate() { if (defined('APP_CONTROLLER_EXISTS')) { @@ -210,6 +212,8 @@ class ControllerTestCaseTest extends CakeTestCase { /** * testGenerateWithComponentConfig + * + * @return void */ public function testGenerateWithComponentConfig() { $Tests = $this->Case->generate('TestConfigs', array( @@ -232,6 +236,8 @@ class ControllerTestCaseTest extends CakeTestCase { /** * Tests ControllerTestCase::generate() using classes from plugins + * + * @return void */ public function testGenerateWithPlugin() { $Tests = $this->Case->generate('TestPlugin.Tests', array( @@ -266,6 +272,8 @@ class ControllerTestCaseTest extends CakeTestCase { /** * Tests testAction + * + * @return void */ public function testTestAction() { $Controller = $this->Case->generate('TestsApps'); @@ -327,6 +335,7 @@ class ControllerTestCaseTest extends CakeTestCase { * Tests not using loaded routes during tests * * @expectedException MissingActionException + * @return void */ public function testSkipRoutes() { Router::connect('/:controller/:action/*'); @@ -338,6 +347,8 @@ class ControllerTestCaseTest extends CakeTestCase { /** * Tests backwards compatibility with setting the return type + * + * @return void */ public function testBCSetReturn() { $this->Case->autoMock = true; @@ -367,6 +378,8 @@ class ControllerTestCaseTest extends CakeTestCase { /** * Tests sending POST data to testAction + * + * @return void */ public function testTestActionPostData() { $this->Case->autoMock = true; @@ -409,6 +422,8 @@ class ControllerTestCaseTest extends CakeTestCase { /** * Tests sending GET data to testAction + * + * @return void */ public function testTestActionGetData() { $this->Case->autoMock = true; @@ -465,6 +480,8 @@ class ControllerTestCaseTest extends CakeTestCase { /** * Tests autoMock ability + * + * @return void */ public function testAutoMock() { $this->Case->autoMock = true; @@ -478,6 +495,8 @@ class ControllerTestCaseTest extends CakeTestCase { /** * Test using testAction and not mocking + * + * @return void */ public function testNoMocking() { $result = $this->Case->testAction('/tests_apps/some_method'); diff --git a/lib/Cake/Test/Case/Utility/ClassRegistryTest.php b/lib/Cake/Test/Case/Utility/ClassRegistryTest.php index dff46aa80..595efc5b2 100644 --- a/lib/Cake/Test/Case/Utility/ClassRegistryTest.php +++ b/lib/Cake/Test/Case/Utility/ClassRegistryTest.php @@ -268,6 +268,7 @@ class ClassRegistryTest extends CakeTestCase { /** * Tests prefixed datasource names for test purposes * + * @return void */ public function testPrefixedTestDatasource() { ClassRegistry::config(array('testing' => true)); @@ -287,6 +288,7 @@ class ClassRegistryTest extends CakeTestCase { /** * Tests that passing the string parameter to init() will return false if the model does not exists * + * @return void */ public function testInitStrict() { $this->assertFalse(ClassRegistry::init('NonExistent', true)); diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php index 04451915b..4758bb98b 100644 --- a/lib/Cake/Test/Case/Utility/DebuggerTest.php +++ b/lib/Cake/Test/Case/Utility/DebuggerTest.php @@ -274,6 +274,8 @@ class DebuggerTest extends CakeTestCase { /** * Test method for testing addFormat with callbacks. + * + * @return void */ public function customFormat($error, $strings) { return $error['error'] . ': I eated an error ' . $error['file']; diff --git a/lib/Cake/Test/Case/Utility/FileTest.php b/lib/Cake/Test/Case/Utility/FileTest.php index 563c045b4..c0bbe8e85 100644 --- a/lib/Cake/Test/Case/Utility/FileTest.php +++ b/lib/Cake/Test/Case/Utility/FileTest.php @@ -125,6 +125,8 @@ class FileTest extends CakeTestCase { /** * testPermission method + * + * @return void */ public function testPermission() { $this->skipIf(DIRECTORY_SEPARATOR === '\\', 'File permissions tests not supported on Windows.'); @@ -548,7 +550,7 @@ class FileTest extends CakeTestCase { $tmpFile = TMP . 'tests' . DS . 'cakephp.file.test.tmp'; if (is_writable(dirname($tmpFile)) && (!file_exists($tmpFile) || is_writable($tmpFile))) { return $tmpFile; - }; + } if ($paintSkip) { $trace = debug_backtrace(); @@ -560,4 +562,5 @@ class FileTest extends CakeTestCase { } return false; } + } diff --git a/lib/Cake/Test/Case/Utility/HashTest.php b/lib/Cake/Test/Case/Utility/HashTest.php index c8a73ec26..037c6a2a7 100644 --- a/lib/Cake/Test/Case/Utility/HashTest.php +++ b/lib/Cake/Test/Case/Utility/HashTest.php @@ -916,6 +916,8 @@ class HashTest extends CakeTestCase { /** * Test that extract() + matching can hit null things. + * + * @return void */ public function testExtractMatchesNull() { $data = array( diff --git a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php index 1a37a5dce..8c695569d 100644 --- a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php +++ b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php @@ -44,6 +44,8 @@ class FirstGenericObject extends GenericObject { /** * A generic callback + * + * @return void */ public function callback() { } @@ -55,6 +57,9 @@ class FirstGenericObject extends GenericObject { */ class SecondGenericObject extends GenericObject { + /** + * @return void + */ public function callback() { } @@ -65,6 +70,9 @@ class SecondGenericObject extends GenericObject { */ class ThirdGenericObject extends GenericObject { + /** + * @return void + */ public function callback() { } diff --git a/lib/Cake/Test/Case/Utility/SetTest.php b/lib/Cake/Test/Case/Utility/SetTest.php index 1641a368f..5009cfbf9 100644 --- a/lib/Cake/Test/Case/Utility/SetTest.php +++ b/lib/Cake/Test/Case/Utility/SetTest.php @@ -1352,6 +1352,8 @@ class SetTest extends CakeTestCase { /** * Test that extract() + matching can hit null things. + * + * @return void */ public function testExtractMatchesNull() { $data = array( diff --git a/lib/Cake/Test/Case/Utility/XmlTest.php b/lib/Cake/Test/Case/Utility/XmlTest.php index a8b38f9bf..38f1ce220 100644 --- a/lib/Cake/Test/Case/Utility/XmlTest.php +++ b/lib/Cake/Test/Case/Utility/XmlTest.php @@ -553,6 +553,7 @@ XML; * testFromArrayFail method * * @dataProvider invalidArrayDataProvider + * @return void */ public function testFromArrayFail($value) { try { @@ -1123,6 +1124,7 @@ XML; * * @dataProvider invalidToArrayDataProvider * @expectedException XmlException + * @return void */ public function testToArrayFail($value) { Xml::toArray($value); diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index 73bb50f5a..f548663cd 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -2236,6 +2236,7 @@ class FormHelperTest extends CakeTestCase { /** * test form->input() with time types. * + * @return void */ public function testInputTime() { extract($this->dateRegex); @@ -8254,6 +8255,7 @@ class FormHelperTest extends CakeTestCase { /** * Test base form URL when url param is passed with multiple parameters (&) * + * @return void */ public function testCreateQuerystringrequest() { $encoding = strtolower(Configure::read('App.encoding')); diff --git a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php index 957f29755..35edd4841 100644 --- a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php @@ -1428,6 +1428,8 @@ class HtmlHelperTest extends CakeTestCase { /** * Test the array form of $startText + * + * @return void */ public function testGetCrumbFirstLink() { $result = $this->Html->getCrumbList(null, 'Home'); @@ -1769,6 +1771,8 @@ class HtmlHelperTest extends CakeTestCase { /** * Test the inline and block options for meta() + * + * @return void */ public function testMetaWithBlocks() { $this->View->expects($this->at(0)) @@ -2028,7 +2032,6 @@ class HtmlHelperTest extends CakeTestCase { /** * testCrumbList method * - * * @return void */ public function testCrumbList() { @@ -2060,6 +2063,8 @@ class HtmlHelperTest extends CakeTestCase { /** * Test getCrumbList startText + * + * @return void */ public function testCrumbListFirstLink() { $this->Html->addCrumb('First', '#first'); diff --git a/lib/Cake/Test/Case/View/Helper/NumberHelperTest.php b/lib/Cake/Test/Case/View/Helper/NumberHelperTest.php index 9d92e7a5b..79bf0da63 100644 --- a/lib/Cake/Test/Case/View/Helper/NumberHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/NumberHelperTest.php @@ -69,6 +69,8 @@ class NumberHelperTest extends CakeTestCase { /** * test CakeNumber class methods are called correctly + * + * @return void */ public function testNumberHelperProxyMethodCalls() { $methods = array( @@ -86,6 +88,8 @@ class NumberHelperTest extends CakeTestCase { /** * test engine override + * + * @return void */ public function testEngineOverride() { App::build(array( diff --git a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php index 73c021c74..068dfd280 100644 --- a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php @@ -74,6 +74,8 @@ class TextHelperTest extends CakeTestCase { /** * test String class methods are called correctly + * + * @return void */ public function testTextHelperProxyMethodCalls() { $methods = array( @@ -90,6 +92,8 @@ class TextHelperTest extends CakeTestCase { /** * test engine override + * + * @return void */ public function testEngineOverride() { App::build(array( diff --git a/lib/Cake/Test/Case/View/Helper/TimeHelperTest.php b/lib/Cake/Test/Case/View/Helper/TimeHelperTest.php index aff6bb752..3b7ab5cad 100644 --- a/lib/Cake/Test/Case/View/Helper/TimeHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/TimeHelperTest.php @@ -78,6 +78,8 @@ class TimeHelperTest extends CakeTestCase { /** * test CakeTime class methods are called correctly + * + * @return void */ public function testTimeHelperProxyMethodCalls() { $methods = array( @@ -104,6 +106,8 @@ class TimeHelperTest extends CakeTestCase { /** * test engine override + * + * @return void */ public function testEngineOverride() { App::build(array( diff --git a/lib/Cake/Test/Case/View/ViewTest.php b/lib/Cake/Test/Case/View/ViewTest.php index e7fabee9d..dd4790b3d 100644 --- a/lib/Cake/Test/Case/View/ViewTest.php +++ b/lib/Cake/Test/Case/View/ViewTest.php @@ -706,6 +706,8 @@ class ViewTest extends CakeTestCase { /** * Test that elements can have callbacks + * + * @return void */ public function testElementCallbacks() { $Helper = $this->getMock('Helper', array(), array($this->View), 'ElementCallbackMockHtmlHelper'); From bbe3b6a4395ea6465b31a85d4633bb9ed303fd2a Mon Sep 17 00:00:00 2001 From: euromark Date: Wed, 2 Apr 2014 03:09:42 +0200 Subject: [PATCH 07/17] more cs --- .../Controller/TestsAppsPostsController.php | 13 +++++++++++++ lib/Cake/TestSuite/CakeTestSuiteCommand.php | 1 + lib/Cake/TestSuite/ControllerTestCase.php | 1 + lib/Cake/TestSuite/Fixture/CakeTestModel.php | 2 +- lib/Cake/TestSuite/Reporter/CakeBaseReporter.php | 10 ++++++++++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Test/test_app/Controller/TestsAppsPostsController.php b/lib/Cake/Test/test_app/Controller/TestsAppsPostsController.php index 46d08da44..98c9107b0 100644 --- a/lib/Cake/Test/test_app/Controller/TestsAppsPostsController.php +++ b/lib/Cake/Test/test_app/Controller/TestsAppsPostsController.php @@ -27,6 +27,11 @@ class TestsAppsPostsController extends AppController { public $viewPath = 'TestsApps'; +/** + * add method + * + * @return void + */ public function add() { $data = array( 'Post' => array( @@ -44,6 +49,7 @@ class TestsAppsPostsController extends AppController { /** * check URL params * + * @return void */ public function url_var() { $this->set('params', $this->request->params); @@ -53,12 +59,18 @@ class TestsAppsPostsController extends AppController { /** * post var testing * + * @return void */ public function post_var() { $this->set('data', $this->request->data); $this->render('index'); } +/** + * input_data() + * + * @return void + */ public function input_data() { $this->set('data', $this->request->input('json_decode', true)); $this->render('index'); @@ -67,6 +79,7 @@ class TestsAppsPostsController extends AppController { /** * Fixturized action for testAction() * + * @return void */ public function fixtured() { $this->set('posts', $this->Post->find('all')); diff --git a/lib/Cake/TestSuite/CakeTestSuiteCommand.php b/lib/Cake/TestSuite/CakeTestSuiteCommand.php index 65e391942..1af5baa8e 100644 --- a/lib/Cake/TestSuite/CakeTestSuiteCommand.php +++ b/lib/Cake/TestSuite/CakeTestSuiteCommand.php @@ -57,6 +57,7 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command { * * @param array $argv * @param boolean $exit + * @return void */ public function run(array $argv, $exit = true) { $this->handleArguments($argv); diff --git a/lib/Cake/TestSuite/ControllerTestCase.php b/lib/Cake/TestSuite/ControllerTestCase.php index 23f03ce79..a2b58c44b 100644 --- a/lib/Cake/TestSuite/ControllerTestCase.php +++ b/lib/Cake/TestSuite/ControllerTestCase.php @@ -94,6 +94,7 @@ class InterceptContentHelper extends Helper { * Intercepts and stores the contents of the view before the layout is rendered * * @param string $viewFile The view file + * @return void */ public function afterRender($viewFile) { $this->_View->assign('__view_no_layout__', $this->_View->fetch('content')); diff --git a/lib/Cake/TestSuite/Fixture/CakeTestModel.php b/lib/Cake/TestSuite/Fixture/CakeTestModel.php index bd23336c4..dc4254211 100644 --- a/lib/Cake/TestSuite/Fixture/CakeTestModel.php +++ b/lib/Cake/TestSuite/Fixture/CakeTestModel.php @@ -47,8 +47,8 @@ class CakeTestModel extends Model { * @param array $data * @param boolean|array $validate * @param array $fieldList + * @return void */ - public function save($data = null, $validate = true, $fieldList = array()) { $db = $this->getDataSource(); $db->columns['datetime']['formatter'] = 'CakeTestSuiteDispatcher::date'; diff --git a/lib/Cake/TestSuite/Reporter/CakeBaseReporter.php b/lib/Cake/TestSuite/Reporter/CakeBaseReporter.php index b14162a72..f98cde85c 100644 --- a/lib/Cake/TestSuite/Reporter/CakeBaseReporter.php +++ b/lib/Cake/TestSuite/Reporter/CakeBaseReporter.php @@ -122,6 +122,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * Print result * * @param PHPUnit_Framework_TestResult $result + * @return void */ public function printResult(PHPUnit_Framework_TestResult $result) { $this->paintFooter($result); @@ -131,6 +132,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * Paint result * * @param PHPUnit_Framework_TestResult $result + * @return void */ public function paintResult(PHPUnit_Framework_TestResult $result) { $this->paintFooter($result); @@ -142,6 +144,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * @param PHPUnit_Framework_Test $test * @param Exception $e * @param float $time + * @return void */ public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) { $this->paintException($e, $test); @@ -153,6 +156,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * @param PHPUnit_Framework_Test $test * @param PHPUnit_Framework_AssertionFailedError $e * @param float $time + * @return void */ public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) { $this->paintFail($e, $test); @@ -164,6 +168,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * @param PHPUnit_Framework_Test $test * @param Exception $e * @param float $time + * @return void */ public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) { $this->paintSkip($e, $test); @@ -175,6 +180,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * @param PHPUnit_Framework_Test $test * @param Exception $e * @param float $time + * @return void */ public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) { $this->paintSkip($e, $test); @@ -184,6 +190,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * A test suite started. * * @param PHPUnit_Framework_TestSuite $suite + * @return void */ public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { if (!$this->_headerSent) { @@ -196,6 +203,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * A test suite ended. * * @param PHPUnit_Framework_TestSuite $suite + * @return void */ public function endTestSuite(PHPUnit_Framework_TestSuite $suite) { } @@ -204,6 +212,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * A test started. * * @param PHPUnit_Framework_Test $test + * @return void */ public function startTest(PHPUnit_Framework_Test $test) { } @@ -213,6 +222,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * * @param PHPUnit_Framework_Test $test * @param float $time + * @return void */ public function endTest(PHPUnit_Framework_Test $test, $time) { $this->numAssertions += $test->getNumAssertions(); From e544340d674dd1770b630ef47deb7a6193d92277 Mon Sep 17 00:00:00 2001 From: euromark Date: Wed, 2 Apr 2014 03:12:22 +0200 Subject: [PATCH 08/17] fix indentation --- lib/Cake/Test/Case/Utility/ObjectCollectionTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php index 8c695569d..5d4d0f30b 100644 --- a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php +++ b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php @@ -57,9 +57,9 @@ class FirstGenericObject extends GenericObject { */ class SecondGenericObject extends GenericObject { - /** - * @return void - */ +/** + * @return void + */ public function callback() { } @@ -70,9 +70,9 @@ class SecondGenericObject extends GenericObject { */ class ThirdGenericObject extends GenericObject { - /** - * @return void - */ +/** + * @return void + */ public function callback() { } From b150e334727293ebbcfbb5f9fa2fb337f2d6274f Mon Sep 17 00:00:00 2001 From: euromark Date: Wed, 2 Apr 2014 03:16:03 +0200 Subject: [PATCH 09/17] correct missed cs errors --- lib/Cake/Test/Case/Cache/CacheTest.php | 4 ++++ lib/Cake/Test/Case/Log/CakeLogTest.php | 3 +++ lib/Cake/Test/Case/View/Helper/TextHelperTest.php | 2 ++ 3 files changed, 9 insertions(+) diff --git a/lib/Cake/Test/Case/Cache/CacheTest.php b/lib/Cake/Test/Case/Cache/CacheTest.php index c030bfb26..445b25782 100644 --- a/lib/Cake/Test/Case/Cache/CacheTest.php +++ b/lib/Cake/Test/Case/Cache/CacheTest.php @@ -246,6 +246,8 @@ class CacheTest extends CakeTestCase { /** * testGroupConfigs method + * + * @return void */ public function testGroupConfigs() { Cache::config('latest', array( @@ -299,7 +301,9 @@ class CacheTest extends CakeTestCase { /** * testGroupConfigsThrowsException method + * * @expectedException CacheException + * @return void */ public function testGroupConfigsThrowsException() { Cache::groupConfigs('bogus'); diff --git a/lib/Cake/Test/Case/Log/CakeLogTest.php b/lib/Cake/Test/Case/Log/CakeLogTest.php index 5ca5f2741..01d9ce0c9 100644 --- a/lib/Cake/Test/Case/Log/CakeLogTest.php +++ b/lib/Cake/Test/Case/Log/CakeLogTest.php @@ -510,6 +510,7 @@ class CakeLogTest extends CakeTestCase { /** * test bogus type and scope * + * @return void */ public function testBogusTypeAndScope() { $this->_resetLogConfig(); @@ -536,6 +537,8 @@ class CakeLogTest extends CakeTestCase { /** * test scoped logging with convenience methods + * + * @return void */ public function testConvenienceScopedLogging() { if (file_exists(LOGS . 'shops.log')) { diff --git a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php index 068dfd280..d38d60529 100644 --- a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php @@ -208,6 +208,8 @@ class TextHelperTest extends CakeTestCase { /** * Data provider for autoLinking + * + * @return array */ public static function autoLinkProvider() { return array( From 5c31641ea85b9f21f4f4f3f7600d8cc5f2112799 Mon Sep 17 00:00:00 2001 From: Ceeram Date: Wed, 2 Apr 2014 23:52:11 +0200 Subject: [PATCH 10/17] Change argument type to mixed in docblock, as debug() and pr() accept not just a single type --- lib/Cake/basics.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index da34f8ac8..92a86ab46 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -63,7 +63,7 @@ if (!function_exists('debug')) { * * Only runs if debug level is greater than zero. * - * @param boolean $var Variable to show debug information for. + * @param mixed $var Variable to show debug information for. * @param boolean $showHtml If set to true, the method prints the debug data in a browser-friendly way. * @param boolean $showFrom If set to true, the method prints from where the function was called. * @return void @@ -236,7 +236,7 @@ if (!function_exists('pr')) { * print_r() will wrap
 tags around the output of given array. Similar to debug().
  *
  * @see debug()
- * @param array $var Variable to print out
+ * @param mixed $var Variable to print out
  * @return void
  * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#pr
  */

From 823909603aca706379434996cff19a2873d22dee Mon Sep 17 00:00:00 2001
From: euromark 
Date: Fri, 4 Apr 2014 19:18:02 +0200
Subject: [PATCH 11/17] correct deprecation notices

---
 lib/Cake/Controller/Controller.php | 1 -
 lib/Cake/Utility/Set.php           | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php
index e8481c899..00b80fb2f 100644
--- a/lib/Cake/Controller/Controller.php
+++ b/lib/Cake/Controller/Controller.php
@@ -1075,7 +1075,6 @@ class Controller extends Object implements CakeEventListener {
  * @param array $whitelist List of allowed options for paging
  * @return array Model query results
  * @link http://book.cakephp.org/2.0/en/controllers.html#Controller::paginate
- * @deprecated Will be removed in 3.0. Use PaginatorComponent instead.
  */
 	public function paginate($object = null, $scope = array(), $whitelist = array()) {
 		return $this->Components->load('Paginator', $this->paginate)->paginate($object, $scope, $whitelist);
diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php
index 8c6bf3c17..c3fdd63db 100644
--- a/lib/Cake/Utility/Set.php
+++ b/lib/Cake/Utility/Set.php
@@ -23,6 +23,7 @@ App::uses('Hash', 'Utility');
  * Class used for manipulation of arrays.
  *
  * @package       Cake.Utility
+ * @deprecated Deprecated since version 2.4, will be removed in 3.0. Use Hash instead.
  */
 class Set {
 

From 854a53b3cb30a32ebb5101d4d9e436c7a10646c5 Mon Sep 17 00:00:00 2001
From: euromark 
Date: Fri, 4 Apr 2014 19:19:10 +0200
Subject: [PATCH 12/17] generalize sentence

---
 lib/Cake/Utility/Set.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php
index c3fdd63db..1da93818a 100644
--- a/lib/Cake/Utility/Set.php
+++ b/lib/Cake/Utility/Set.php
@@ -23,7 +23,7 @@ App::uses('Hash', 'Utility');
  * Class used for manipulation of arrays.
  *
  * @package       Cake.Utility
- * @deprecated Deprecated since version 2.4, will be removed in 3.0. Use Hash instead.
+ * @deprecated Will be removed in 3.0. Use Hash instead.
  */
 class Set {
 

From b8e21c99ee33ba2fa9d9bb2a7751c001ad3b35cf Mon Sep 17 00:00:00 2001
From: mark_story 
Date: Fri, 4 Apr 2014 21:26:31 -0400
Subject: [PATCH 13/17] Only count `_id` if it is the last 3 characters in the
 field name.

This prevents issues when baking models for tables containing `_id`.

Fixes #3230
---
 lib/Cake/Console/Command/Task/ModelTask.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php
index e12ebb283..67d2cd78d 100644
--- a/lib/Cake/Console/Command/Task/ModelTask.php
+++ b/lib/Cake/Console/Command/Task/ModelTask.php
@@ -572,7 +572,7 @@ class ModelTask extends BakeTask {
 	public function findBelongsTo(Model $model, $associations) {
 		$fieldNames = array_keys($model->schema(true));
 		foreach ($fieldNames as $fieldName) {
-			$offset = strpos($fieldName, '_id');
+			$offset = substr($fieldName, -3) === '_id';
 			if ($fieldName != $model->primaryKey && $fieldName !== 'parent_id' && $offset !== false) {
 				$tmpModelName = $this->_modelNameFromKey($fieldName);
 				$associations['belongsTo'][] = array(

From 4ec81542dba716619a5221308a6bdbe0fbbee091 Mon Sep 17 00:00:00 2001
From: mark_story 
Date: Fri, 4 Apr 2014 21:45:04 -0400
Subject: [PATCH 14/17] Fix email rendering when using 2 different plugins.

When an email template and layout are in different plugins the incorrect
plugin would be used for the layout.

Fixes #3062
---
 lib/Cake/Network/Email/CakeEmail.php               | 14 +++++++-------
 lib/Cake/Test/Case/Network/Email/CakeEmailTest.php | 10 +++++++++-
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/lib/Cake/Network/Email/CakeEmail.php b/lib/Cake/Network/Email/CakeEmail.php
index f0cd00f30..9500a7678 100644
--- a/lib/Cake/Network/Email/CakeEmail.php
+++ b/lib/Cake/Network/Email/CakeEmail.php
@@ -1638,21 +1638,21 @@ class CakeEmail {
 			$View->plugin = $layoutPlugin;
 		}
 
-		// Convert null to false, as View needs false to disable
-		// the layout.
-		if ($layout === null) {
-			$layout = false;
-		}
-
 		if ($View->get('content') === null) {
 			$View->set('content', $content);
 		}
 
+		// Convert null to false, as View needs false to disable
+		// the layout.
+		if ($this->_layout === null) {
+			$this->_layout = false;
+		}
+
 		foreach ($types as $type) {
 			$View->hasRendered = false;
 			$View->viewPath = $View->layoutPath = 'Emails' . DS . $type;
 
-			$render = $View->render($template, $layout);
+			$render = $View->render($this->_template, $this->_layout);
 			$render = str_replace(array("\r\n", "\r"), "\n", $render);
 			$rendered[$type] = $this->_encodeString($render, $this->charset);
 		}
diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
index 5b0fdf6ed..362081cca 100644
--- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
+++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
@@ -1472,7 +1472,7 @@ class CakeEmailTest extends CakeTestCase {
 		App::build(array(
 			'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
 		));
-		CakePlugin::load('TestPlugin');
+		CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
 
 		$this->CakeEmail->reset();
 		$this->CakeEmail->transport('debug');
@@ -1493,6 +1493,14 @@ class CakeEmailTest extends CakeTestCase {
 		$this->assertContains('Into TestPlugin.', $result['message']);
 		$this->assertContains('This email was sent using the TestPlugin.', $result['message']);
 
+		$this->CakeEmail->template(
+			'TestPlugin.test_plugin_tpl',
+			'TestPluginTwo.default'
+		);
+		$result = $this->CakeEmail->send();
+		$this->assertContains('Into TestPlugin.', $result['message']);
+		$this->assertContains('This email was sent using TestPluginTwo.', $result['message']);
+
 		// test plugin template overridden by theme
 		$this->CakeEmail->theme('TestTheme');
 		$result = $this->CakeEmail->send();

From 7fb920c256abc0259ea8ffecdc82383ef9c67d21 Mon Sep 17 00:00:00 2001
From: mark_story 
Date: Fri, 4 Apr 2014 22:22:38 -0400
Subject: [PATCH 15/17] Add file missed in last commit.

---
 .../Plugin/TestPluginTwo/View/Layouts/Emails/text/default.ctp | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 lib/Cake/Test/test_app/Plugin/TestPluginTwo/View/Layouts/Emails/text/default.ctp

diff --git a/lib/Cake/Test/test_app/Plugin/TestPluginTwo/View/Layouts/Emails/text/default.ctp b/lib/Cake/Test/test_app/Plugin/TestPluginTwo/View/Layouts/Emails/text/default.ctp
new file mode 100644
index 000000000..6e490fa42
--- /dev/null
+++ b/lib/Cake/Test/test_app/Plugin/TestPluginTwo/View/Layouts/Emails/text/default.ctp
@@ -0,0 +1,4 @@
+
+fetch('content'); ?>
+
+This email was sent using TestPluginTwo.

From 92800889a677899fd5c7a82fb7bab2cbfff887a3 Mon Sep 17 00:00:00 2001
From: mark_story 
Date: Fri, 4 Apr 2014 22:25:48 -0400
Subject: [PATCH 16/17] Update version number to 2.4.7

---
 lib/Cake/VERSION.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Cake/VERSION.txt b/lib/Cake/VERSION.txt
index 268820d46..ddabde088 100644
--- a/lib/Cake/VERSION.txt
+++ b/lib/Cake/VERSION.txt
@@ -17,4 +17,4 @@
 // @license       http://www.opensource.org/licenses/mit-license.php MIT License
 // +--------------------------------------------------------------------------------------------+ //
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-2.4.6
+2.4.7

From 0d80c92ffbdd2d8eabad11f6be56333aff5a8a0a Mon Sep 17 00:00:00 2001
From: Jose Lorenzo Rodriguez 
Date: Sun, 6 Apr 2014 21:48:59 +0200
Subject: [PATCH 17/17] Revert "Merge pull request #3002 from moberemk/patch-2"

This reverts commit 8e3d6cffb706b7ded3849b5ae9f29515cc610063, reversing
changes made to 92800889a677899fd5c7a82fb7bab2cbfff887a3.
---
 lib/Cake/View/Helper/HtmlHelper.php | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/Cake/View/Helper/HtmlHelper.php b/lib/Cake/View/Helper/HtmlHelper.php
index b93594f56..d26ba64f3 100644
--- a/lib/Cake/View/Helper/HtmlHelper.php
+++ b/lib/Cake/View/Helper/HtmlHelper.php
@@ -174,13 +174,12 @@ class HtmlHelper extends AppHelper {
  * @param string $name Text for link
  * @param string $link URL for link (if empty it won't be a link)
  * @param string|array $options Link attributes e.g. array('id' => 'selected')
- * @return this HtmlHelper
+ * @return void
  * @see HtmlHelper::link() for details on $options that can be used.
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper
  */
 	public function addCrumb($name, $link = null, $options = null) {
 		$this->_crumbs[] = array($name, $link, $options);
-		return $this;
 	}
 
 /**