diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index e1cdfa2ae..128674b5b 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -593,7 +593,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( diff --git a/lib/Cake/Console/Command/TestShell.php b/lib/Cake/Console/Command/TestShell.php index 912fdac53..bd7e9d277 100644 --- a/lib/Cake/Console/Command/TestShell.php +++ b/lib/Cake/Console/Command/TestShell.php @@ -172,7 +172,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)')); } } 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/Network/Email/CakeEmail.php b/lib/Cake/Network/Email/CakeEmail.php index ca75278d5..201d42cea 100644 --- a/lib/Cake/Network/Email/CakeEmail.php +++ b/lib/Cake/Network/Email/CakeEmail.php @@ -1645,21 +1645,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/Cache/CacheTest.php b/lib/Cake/Test/Case/Cache/CacheTest.php index a3a48fd89..0bdb3f1fa 100644 --- a/lib/Cake/Test/Case/Cache/CacheTest.php +++ b/lib/Cake/Test/Case/Cache/CacheTest.php @@ -248,6 +248,8 @@ class CacheTest extends CakeTestCase { /** * testGroupConfigs method + * + * @return void */ public function testGroupConfigs() { Cache::config('latest', array( @@ -301,7 +303,9 @@ class CacheTest extends CakeTestCase { /** * testGroupConfigsThrowsException method + * * @expectedException CacheException + * @return void */ public function testGroupConfigsThrowsException() { Cache::groupConfigs('bogus'); 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 ebca0537f..c91b570ac 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php @@ -534,6 +534,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 f308a267b..7d9365c84 100644 --- a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php @@ -628,6 +628,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 3a79306d4..ce13a4c9d 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 ac1f3b7f4..2dddeabd7 100644 --- a/lib/Cake/Test/Case/Log/CakeLogTest.php +++ b/lib/Cake/Test/Case/Log/CakeLogTest.php @@ -257,6 +257,7 @@ class CakeLogTest extends CakeTestCase { * test enable * * @expectedException CakeLogException + * @return void */ public function testStreamEnable() { CakeLog::config('spam', array( @@ -272,6 +273,7 @@ class CakeLogTest extends CakeTestCase { * test disable * * @expectedException CakeLogException + * @return void */ public function testStreamDisable() { CakeLog::config('spam', array( @@ -289,6 +291,7 @@ class CakeLogTest extends CakeTestCase { * test enabled() invalid stream * * @expectedException CakeLogException + * @return void */ public function testStreamEnabledInvalid() { CakeLog::enabled('bogus_stream'); @@ -298,11 +301,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', @@ -316,6 +325,11 @@ class CakeLogTest extends CakeTestCase { )); } +/** + * delete logs + * + * @return void + */ protected function _deleteLogs() { if (file_exists(LOGS . 'shops.log')) { unlink(LOGS . 'shops.log'); @@ -493,6 +507,7 @@ class CakeLogTest extends CakeTestCase { /** * test bogus type and scope * + * @return void */ public function testBogusTypeAndScope() { $this->_resetLogConfig(); @@ -524,6 +539,8 @@ class CakeLogTest extends CakeTestCase { /** * test scoped logging with convenience methods + * + * @return void */ public function testConvenienceScopedLogging() { if (file_exists(LOGS . 'shops.log')) { @@ -570,6 +587,8 @@ class CakeLogTest extends CakeTestCase { /** * test convenience methods + * + * @return void */ public function testConvenienceMethods() { $this->_deleteLogs(); @@ -644,6 +663,8 @@ class CakeLogTest extends CakeTestCase { /** * test levels customization + * + * @return void */ public function testLevelCustomization() { $this->skipIf(DIRECTORY_SEPARATOR === '\\', 'Log level tests not supported on Windows.'); @@ -674,6 +695,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 b6dddf44d..47af91847 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 fd5182cd4..4092c5e61 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 512e32a40..cab74864f 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 e2227adb1..c67d51950 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 e97e5fdc5..ca25e0359 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 b06207510..294ce636f 100644 --- a/lib/Cake/Test/Case/Model/ModelReadTest.php +++ b/lib/Cake/Test/Case/Model/ModelReadTest.php @@ -7831,6 +7831,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/ModelValidationTest.php b/lib/Cake/Test/Case/Model/ModelValidationTest.php index 0c18d7492..8a3d266fd 100644 --- a/lib/Cake/Test/Case/Model/ModelValidationTest.php +++ b/lib/Cake/Test/Case/Model/ModelValidationTest.php @@ -2078,7 +2078,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..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'); @@ -6784,7 +6788,7 @@ class ModelWriteTest extends BaseModelTest { /** * testSaveAllFieldListHasMany method * - * return @void + * @return void */ public function testSaveAllFieldListHasMany() { $this->loadFixtures('Article', 'Comment'); @@ -6971,7 +6975,7 @@ class ModelWriteTest extends BaseModelTest { /** * testSaveAllDeepFieldListHasMany method * - * return @void + * @return void */ public function testSaveAllDeepFieldListHasMany() { $this->loadFixtures('Article', 'Comment', 'User'); @@ -7014,7 +7018,7 @@ class ModelWriteTest extends BaseModelTest { /** * testSaveAllDeepHasManyBelongsTo method * - * return @void + * @return void */ public function testSaveAllDeepHasManyBelongsTo() { $this->loadFixtures('Article', 'Comment', 'User'); @@ -7066,7 +7070,7 @@ class ModelWriteTest extends BaseModelTest { /** * testSaveAllDeepHasManyhasMany method * - * return @void + * @return void */ public function testSaveAllDeepHasManyHasMany() { $this->loadFixtures('Article', 'Comment', 'User', 'Attachment'); @@ -7122,7 +7126,7 @@ class ModelWriteTest extends BaseModelTest { /** * testSaveAllDeepOrderHasManyHasMany method * - * return @void + * @return void */ public function testSaveAllDeepOrderHasManyHasMany() { $this->loadFixtures('Article', 'Comment', 'User', 'Attachment'); @@ -7159,7 +7163,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 +7201,7 @@ class ModelWriteTest extends BaseModelTest { /** * testUpdateAllBoolean * - * return @void + * @return void */ public function testUpdateAllBoolean() { $this->loadFixtures('Item', 'Syfile', 'Portfolio', 'Image', 'ItemsPortfolio'); @@ -7212,7 +7216,7 @@ class ModelWriteTest extends BaseModelTest { /** * testUpdateAllBooleanConditions * - * return @void + * @return void */ public function testUpdateAllBooleanConditions() { $this->loadFixtures('Item', 'Syfile', 'Portfolio', 'Image', 'ItemsPortfolio'); @@ -7229,7 +7233,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/Model/models.php b/lib/Cake/Test/Case/Model/models.php index 6512f3824..99b1fa1cf 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; @@ -2763,6 +2772,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 32517f241..2dc28941c 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( @@ -1303,6 +1305,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 d7ca1e90f..c3c0181b0 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(); @@ -86,6 +87,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the body method * + * @return void */ public function testBody() { $response = new CakeResponse(); @@ -98,6 +100,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the charset method * + * @return void */ public function testCharset() { $response = new CakeResponse(); @@ -111,6 +114,7 @@ class CakeResponseTest extends CakeTestCase { * Tests the statusCode method * * @expectedException CakeException + * @return void */ public function testStatusCode() { $response = new CakeResponse(); @@ -126,6 +130,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the type method * + * @return void */ public function testType() { $response = new CakeResponse(); @@ -148,6 +153,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the header method * + * @return void */ public function testHeader() { $response = new CakeResponse(); @@ -196,6 +202,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the send method * + * @return void */ public function testSend() { $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', '_setCookies')); @@ -241,7 +248,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')); @@ -261,6 +270,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')); @@ -282,6 +292,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')); @@ -299,6 +310,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the disableCache method * + * @return void */ public function testDisableCache() { $response = new CakeResponse(); @@ -314,6 +326,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the cache method * + * @return void */ public function testCache() { $response = new CakeResponse(); @@ -386,6 +399,7 @@ class CakeResponseTest extends CakeTestCase { * Tests the httpCodes method * * @expectedException CakeException + * @return void */ public function testHttpCodes() { $response = new CakeResponse(); @@ -430,6 +444,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the download method * + * @return void */ public function testDownload() { $response = new CakeResponse(); @@ -443,6 +458,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the mapType method * + * @return void */ public function testMapType() { $response = new CakeResponse(); @@ -459,6 +475,7 @@ class CakeResponseTest extends CakeTestCase { /** * Tests the outputCompressed method * + * @return void */ public function testOutputCompressed() { $response = new CakeResponse(); @@ -496,6 +513,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/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/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php index 934254458..9cb3ca321 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 * @@ -339,6 +343,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'; @@ -1469,7 +1475,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'); @@ -1490,6 +1496,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(); @@ -2054,6 +2068,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')); @@ -2105,6 +2121,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')); @@ -2124,6 +2145,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')); @@ -2143,6 +2169,11 @@ class CakeEmailTest extends CakeTestCase { return $email; } +/** + * testWrapLongLine() + * + * @return void + */ public function testWrapLongLine() { $message = '' . str_repeat('x', CakeEmail::LINE_LENGTH_MUST) . ""; @@ -2183,6 +2214,11 @@ class CakeEmailTest extends CakeTestCase { $this->assertLineLengths($result['message']); } +/** + * testWrapWithTagsAcrossLines() + * + * @return void + */ public function testWrapWithTagsAcrossLines() { $str = << @@ -2207,6 +2243,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/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/Routing/DispatcherTest.php b/lib/Cake/Test/Case/Routing/DispatcherTest.php index b43f61920..e7b61f5d7 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 96c7d5e4c..d1a466980 100644 --- a/lib/Cake/Test/Case/Routing/RouterTest.php +++ b/lib/Cake/Test/Case/Routing/RouterTest.php @@ -2410,6 +2410,8 @@ class RouterTest extends CakeTestCase { /** * test using custom route class in PluginDot notation + * + * @return void */ public function testUsingCustomRouteClassPluginDotSyntax() { App::build(array( @@ -2572,6 +2574,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 57d699eb3..63cc39e41 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 f3c9878e7..6a478f35d 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.'); @@ -532,7 +534,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()); @@ -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(); diff --git a/lib/Cake/Test/Case/Utility/HashTest.php b/lib/Cake/Test/Case/Utility/HashTest.php index 1d35363cc..7395af40c 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'); @@ -920,6 +920,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..5d4d0f30b 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 029b17a35..f55afd106 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 b09e6ad8e..767e125e1 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 { @@ -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 35f7306f0..a5ff2df54 100755 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -2288,6 +2288,7 @@ class FormHelperTest extends CakeTestCase { /** * test form->input() with time types. * + * @return void */ public function testInputTime() { extract($this->dateRegex); @@ -8374,6 +8375,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..d38d60529 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( @@ -204,6 +208,8 @@ class TextHelperTest extends CakeTestCase { /** * Data provider for autoLinking + * + * @return array */ public static function autoLinkProvider() { return 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 cda0e3037..7ad86dd15 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'); 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/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. 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(); diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php index 8c6bf3c17..1da93818a 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 Will be removed in 3.0. Use Hash instead. */ class Set { diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index a8ec196f0..60deced1c 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -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
  */