Merge branch 'master' into 2.5

Conflicts:
	lib/Cake/Test/Case/Utility/FileTest.php
	lib/Cake/VERSION.txt
This commit is contained in:
Jose Lorenzo Rodriguez 2014-04-06 21:50:41 +02:00
commit 343d3279b9
65 changed files with 348 additions and 37 deletions

View file

@ -593,7 +593,7 @@ class ModelTask extends BakeTask {
public function findBelongsTo(Model $model, $associations) { public function findBelongsTo(Model $model, $associations) {
$fieldNames = array_keys($model->schema(true)); $fieldNames = array_keys($model->schema(true));
foreach ($fieldNames as $fieldName) { foreach ($fieldNames as $fieldName) {
$offset = strpos($fieldName, '_id'); $offset = substr($fieldName, -3) === '_id';
if ($fieldName != $model->primaryKey && $fieldName !== 'parent_id' && $offset !== false) { if ($fieldName != $model->primaryKey && $fieldName !== 'parent_id' && $offset !== false) {
$tmpModelName = $this->_modelNameFromKey($fieldName); $tmpModelName = $this->_modelNameFromKey($fieldName);
$associations['belongsTo'][] = array( $associations['belongsTo'][] = array(

View file

@ -172,7 +172,7 @@ class TestShell extends Shell {
$this->_dispatcher = new CakeTestSuiteDispatcher(); $this->_dispatcher = new CakeTestSuiteDispatcher();
$success = $this->_dispatcher->loadTestFramework(); $success = $this->_dispatcher->loadTestFramework();
if (!$success) { if (!$success) {
throw new Exception(__d('cake_dev', 'Please install PHPUnit framework <info>(http://www.phpunit.de)</info>')); throw new Exception(__d('cake_dev', 'Please install PHPUnit framework v3.7 <info>(http://www.phpunit.de)</info>'));
} }
} }

View file

@ -1075,7 +1075,6 @@ class Controller extends Object implements CakeEventListener {
* @param array $whitelist List of allowed options for paging * @param array $whitelist List of allowed options for paging
* @return array Model query results * @return array Model query results
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::paginate * @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()) { public function paginate($object = null, $scope = array(), $whitelist = array()) {
return $this->Components->load('Paginator', $this->paginate)->paginate($object, $scope, $whitelist); return $this->Components->load('Paginator', $this->paginate)->paginate($object, $scope, $whitelist);

View file

@ -1645,21 +1645,21 @@ class CakeEmail {
$View->plugin = $layoutPlugin; $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) { if ($View->get('content') === null) {
$View->set('content', $content); $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) { foreach ($types as $type) {
$View->hasRendered = false; $View->hasRendered = false;
$View->viewPath = $View->layoutPath = 'Emails' . DS . $type; $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); $render = str_replace(array("\r\n", "\r"), "\n", $render);
$rendered[$type] = $this->_encodeString($render, $this->charset); $rendered[$type] = $this->_encodeString($render, $this->charset);
} }

View file

@ -248,6 +248,8 @@ class CacheTest extends CakeTestCase {
/** /**
* testGroupConfigs method * testGroupConfigs method
*
* @return void
*/ */
public function testGroupConfigs() { public function testGroupConfigs() {
Cache::config('latest', array( Cache::config('latest', array(
@ -301,7 +303,9 @@ class CacheTest extends CakeTestCase {
/** /**
* testGroupConfigsThrowsException method * testGroupConfigsThrowsException method
*
* @expectedException CacheException * @expectedException CacheException
* @return void
*/ */
public function testGroupConfigsThrowsException() { public function testGroupConfigsThrowsException() {
Cache::groupConfigs('bogus'); Cache::groupConfigs('bogus');

View file

@ -453,6 +453,8 @@ class FileEngineTest extends CakeTestCase {
/** /**
* Test that clearing with repeat writes works properly * Test that clearing with repeat writes works properly
*
* @return void
*/ */
public function testClearingWithRepeatWrites() { public function testClearingWithRepeatWrites() {
Cache::config('repeat', array( Cache::config('repeat', array(

View file

@ -534,6 +534,8 @@ class TestTaskTest extends CakeTestCase {
/** /**
* Test generateUses() * Test generateUses()
*
* @return void
*/ */
public function testGenerateUses() { public function testGenerateUses() {
$result = $this->Task->generateUses('model', 'Model', 'Post'); $result = $this->Task->generateUses('model', 'Model', 'Post');

View file

@ -258,6 +258,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
* test parsing options that do not exist. * test parsing options that do not exist.
* *
* @expectedException ConsoleException * @expectedException ConsoleException
* @return void
*/ */
public function testOptionThatDoesNotExist() { public function testOptionThatDoesNotExist() {
$parser = new ConsoleOptionParser('test', false); $parser = new ConsoleOptionParser('test', false);
@ -270,6 +271,7 @@ class ConsoleOptionParserTest extends CakeTestCase {
* test parsing short options that do not exist. * test parsing short options that do not exist.
* *
* @expectedException ConsoleException * @expectedException ConsoleException
* @return void
*/ */
public function testShortOptionThatDoesNotExist() { public function testShortOptionThatDoesNotExist() {
$parser = new ConsoleOptionParser('test', false); $parser = new ConsoleOptionParser('test', false);

View file

@ -840,6 +840,8 @@ TEXT;
/** /**
* Test file and console and logging * Test file and console and logging
*
* @return void
*/ */
public function testFileAndConsoleLogging() { public function testFileAndConsoleLogging() {
// file logging // file logging
@ -886,6 +888,8 @@ TEXT;
/** /**
* Test file and console and logging quiet output * Test file and console and logging quiet output
*
* @return void
*/ */
public function testQuietLog() { public function testQuietLog() {
$output = $this->getMock('ConsoleOutput', array(), array(), '', false); $output = $this->getMock('ConsoleOutput', array(), array(), '', false);

View file

@ -29,6 +29,8 @@ class PhpAclTest extends CakeTestCase {
/** /**
* Setup * Setup
*
* @return void
*/ */
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
@ -44,6 +46,8 @@ class PhpAclTest extends CakeTestCase {
/** /**
* Test role inheritance * Test role inheritance
*
* @return void
*/ */
public function testRoleInheritance() { public function testRoleInheritance() {
$roles = $this->Acl->Aro->roles('User/peter'); $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() { public function testAddRole() {
$this->assertEquals(array(array(PhpAro::DEFAULT_ROLE)), $this->Acl->Aro->roles('foobar')); $this->assertEquals(array(array(PhpAro::DEFAULT_ROLE)), $this->Acl->Aro->roles('foobar'));
@ -68,6 +74,8 @@ class PhpAclTest extends CakeTestCase {
/** /**
* Test resolving ARO * Test resolving ARO
*
* @return void
*/ */
public function testAroResolve() { public function testAroResolve() {
$this->Acl->Aro->map = array( $this->Acl->Aro->map = array(
@ -92,6 +100,8 @@ class PhpAclTest extends CakeTestCase {
/** /**
* test correct resolution of defined aliases * test correct resolution of defined aliases
*
* @return void
*/ */
public function testAroAliases() { public function testAroAliases() {
$this->Acl->Aro->map = array( $this->Acl->Aro->map = array(
@ -193,6 +203,8 @@ class PhpAclTest extends CakeTestCase {
/** /**
* lhs of defined rules are case insensitive * lhs of defined rules are case insensitive
*
* @return void
*/ */
public function testCheckIsCaseInsensitive() { public function testCheckIsCaseInsensitive() {
$this->assertTrue($this->Acl->check('hardy', 'controllers/forms/new')); $this->assertTrue($this->Acl->check('hardy', 'controllers/forms/new'));
@ -203,6 +215,8 @@ class PhpAclTest extends CakeTestCase {
/** /**
* allow should work in-memory * allow should work in-memory
*
* @return void
*/ */
public function testAllow() { public function testAllow() {
$this->assertFalse($this->Acl->check('jeff', 'foo/bar')); $this->assertFalse($this->Acl->check('jeff', 'foo/bar'));
@ -223,6 +237,8 @@ class PhpAclTest extends CakeTestCase {
/** /**
* deny should work in-memory * deny should work in-memory
*
* @return void
*/ */
public function testDeny() { public function testDeny() {
$this->assertTrue($this->Acl->check('stan', 'controllers/baz/manager_foo')); $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 * test that a deny rule wins over an equally specific allow rule
*
* @return void
*/ */
public function testDenyRuleIsStrongerThanAllowRule() { public function testDenyRuleIsStrongerThanAllowRule() {
$this->assertFalse($this->Acl->check('peter', 'baz/bam')); $this->assertFalse($this->Acl->check('peter', 'baz/bam'));
@ -261,6 +279,8 @@ class PhpAclTest extends CakeTestCase {
/** /**
* test that an invalid configuration throws exception * test that an invalid configuration throws exception
*
* @return void
*/ */
public function testInvalidConfigWithAroMissing() { public function testInvalidConfigWithAroMissing() {
$this->setExpectedException( $this->setExpectedException(
@ -286,6 +306,8 @@ class PhpAclTest extends CakeTestCase {
/** /**
* test resolving of ACOs * test resolving of ACOs
*
* @return void
*/ */
public function testAcoResolve() { public function testAcoResolve() {
$this->assertEquals(array('foo', 'bar'), $this->Acl->Aco->resolve('foo/bar')); $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 * test that declaring cyclic dependencies should give an error when building the tree
*
* @return void
*/ */
public function testAroDeclarationContainsCycles() { public function testAroDeclarationContainsCycles() {
$config = array( $config = array(
@ -328,6 +352,8 @@ class PhpAclTest extends CakeTestCase {
/** /**
* test that with policy allow, only denies count * test that with policy allow, only denies count
*
* @return void
*/ */
public function testPolicy() { public function testPolicy() {
// allow by default // 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'));
$this->assertFalse($this->Acl->check('Role/sales', 'controllers/bar', 'delete')); $this->assertFalse($this->Acl->check('Role/sales', 'controllers/bar', 'delete'));
} }
} }

View file

@ -46,6 +46,7 @@ class ControllerAuthorizeTest extends CakeTestCase {
/** /**
* @expectedException PHPUnit_Framework_Error * @expectedException PHPUnit_Framework_Error
* @return void
*/ */
public function testControllerTypeError() { public function testControllerTypeError() {
$this->auth->controller(new StdClass()); $this->auth->controller(new StdClass());
@ -53,6 +54,7 @@ class ControllerAuthorizeTest extends CakeTestCase {
/** /**
* @expectedException CakeException * @expectedException CakeException
* @return void
*/ */
public function testControllerErrorOnMissingMethod() { public function testControllerErrorOnMissingMethod() {
$this->auth->controller(new Controller()); $this->auth->controller(new Controller());
@ -85,4 +87,5 @@ class ControllerAuthorizeTest extends CakeTestCase {
$this->assertTrue($this->auth->authorize($user, $request)); $this->assertTrue($this->auth->authorize($user, $request));
} }
} }

View file

@ -628,6 +628,8 @@ class CookieComponentTest extends CakeTestCase {
/** /**
* Test reading empty values. * Test reading empty values.
*
* @return void
*/ */
public function testReadEmpty() { public function testReadEmpty() {
$_COOKIE['CakeTestCookie'] = array( $_COOKIE['CakeTestCookie'] = array(

View file

@ -863,6 +863,8 @@ HTMLBLOC;
/** /**
* Make sure from/to are not double encoded when UTF-8 is present * Make sure from/to are not double encoded when UTF-8 is present
*
* @return void
*/ */
public function testEncodingFrom() { public function testEncodingFrom() {
$this->Controller->EmailTest->to = 'Teßt <test@example.com>'; $this->Controller->EmailTest->to = 'Teßt <test@example.com>';

View file

@ -677,6 +677,7 @@ class PaginatorComponentTest extends CakeTestCase {
* Tests for missing models * Tests for missing models
* *
* @expectedException MissingModelException * @expectedException MissingModelException
* @return void
*/ */
public function testPaginateMissingModel() { public function testPaginateMissingModel() {
$Controller = new PaginatorTestController($this->request); $Controller = new PaginatorTestController($this->request);

View file

@ -172,6 +172,7 @@ class SecurityComponentTest extends CakeTestCase {
* visibility keyword in the blackhole callback * visibility keyword in the blackhole callback
* *
* @expectedException BadRequestException * @expectedException BadRequestException
* @return void
*/ */
public function testBlackholeWithBrokenCallback() { public function testBlackholeWithBrokenCallback() {
$request = new CakeRequest('posts/index', false); $request = new CakeRequest('posts/index', false);
@ -830,7 +831,7 @@ class SecurityComponentTest extends CakeTestCase {
/** /**
* Test that validatePost fails when unlocked fields are changed. * Test that validatePost fails when unlocked fields are changed.
* *
* @return * @return void
*/ */
public function testValidatePostFailDisabledFieldTampering() { public function testValidatePostFailDisabledFieldTampering() {
$this->Controller->Security->startup($this->Controller); $this->Controller->Security->startup($this->Controller);

View file

@ -64,6 +64,7 @@ class ScaffoldMockControllerWithFields extends Controller {
* function beforeScaffold * function beforeScaffold
* *
* @param string method * @param string method
* @return boolean true
*/ */
public function beforeScaffold($method) { public function beforeScaffold($method) {
$this->set('scaffoldFields', array('title')); $this->set('scaffoldFields', array('title'));
@ -82,7 +83,8 @@ class TestScaffoldMock extends Scaffold {
/** /**
* Overload _scaffold * Overload _scaffold
* *
* @param unknown_type $params * @param CakeRequest $request
* @return void
*/ */
protected function _scaffold(CakeRequest $request) { protected function _scaffold(CakeRequest $request) {
$this->_params = $request; $this->_params = $request;

View file

@ -362,6 +362,8 @@ class AppTest extends CakeTestCase {
/** /**
* Make sure that .svn and friends are excluded from App::objects('plugin') * Make sure that .svn and friends are excluded from App::objects('plugin')
*
* @return void
*/ */
public function testListObjectsIgnoreDotDirectories() { public function testListObjectsIgnoreDotDirectories() {
$path = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS; $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 * 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 * app and plugins if it does not find the class in other configured paths
* *
* @return void
*/ */
public function testLoadClassInLibs() { public function testLoadClassInLibs() {
App::build(array( App::build(array(

View file

@ -436,6 +436,7 @@ class ConfigureTest extends CakeTestCase {
/** /**
* @expectedException ConfigureException * @expectedException ConfigureException
* @return void
*/ */
public function testDumpNoAdapter() { public function testDumpNoAdapter() {
Configure::dump(TMP . 'test.php', 'does_not_exist'); Configure::dump(TMP . 'test.php', 'does_not_exist');

View file

@ -270,6 +270,8 @@ class ExceptionRendererTest extends CakeTestCase {
/** /**
* test that helpers in custom CakeErrorController are not lost * test that helpers in custom CakeErrorController are not lost
*
* @return void
*/ */
public function testCakeErrorHelpersNotLost() { public function testCakeErrorHelpersNotLost() {
$testApp = CAKE . 'Test' . DS . 'test_app' . DS; $testApp = CAKE . 'Test' . DS . 'test_app' . DS;

View file

@ -257,6 +257,7 @@ class CakeLogTest extends CakeTestCase {
* test enable * test enable
* *
* @expectedException CakeLogException * @expectedException CakeLogException
* @return void
*/ */
public function testStreamEnable() { public function testStreamEnable() {
CakeLog::config('spam', array( CakeLog::config('spam', array(
@ -272,6 +273,7 @@ class CakeLogTest extends CakeTestCase {
* test disable * test disable
* *
* @expectedException CakeLogException * @expectedException CakeLogException
* @return void
*/ */
public function testStreamDisable() { public function testStreamDisable() {
CakeLog::config('spam', array( CakeLog::config('spam', array(
@ -289,6 +291,7 @@ class CakeLogTest extends CakeTestCase {
* test enabled() invalid stream * test enabled() invalid stream
* *
* @expectedException CakeLogException * @expectedException CakeLogException
* @return void
*/ */
public function testStreamEnabledInvalid() { public function testStreamEnabledInvalid() {
CakeLog::enabled('bogus_stream'); CakeLog::enabled('bogus_stream');
@ -298,11 +301,17 @@ class CakeLogTest extends CakeTestCase {
* test disable invalid stream * test disable invalid stream
* *
* @expectedException CakeLogException * @expectedException CakeLogException
* @return void
*/ */
public function testStreamDisableInvalid() { public function testStreamDisableInvalid() {
CakeLog::disable('bogus_stream'); CakeLog::disable('bogus_stream');
} }
/**
* resets log config
*
* @return void
*/
protected function _resetLogConfig() { protected function _resetLogConfig() {
CakeLog::config('debug', array( CakeLog::config('debug', array(
'engine' => 'File', 'engine' => 'File',
@ -316,6 +325,11 @@ class CakeLogTest extends CakeTestCase {
)); ));
} }
/**
* delete logs
*
* @return void
*/
protected function _deleteLogs() { protected function _deleteLogs() {
if (file_exists(LOGS . 'shops.log')) { if (file_exists(LOGS . 'shops.log')) {
unlink(LOGS . 'shops.log'); unlink(LOGS . 'shops.log');
@ -493,6 +507,7 @@ class CakeLogTest extends CakeTestCase {
/** /**
* test bogus type and scope * test bogus type and scope
* *
* @return void
*/ */
public function testBogusTypeAndScope() { public function testBogusTypeAndScope() {
$this->_resetLogConfig(); $this->_resetLogConfig();
@ -524,6 +539,8 @@ class CakeLogTest extends CakeTestCase {
/** /**
* test scoped logging with convenience methods * test scoped logging with convenience methods
*
* @return void
*/ */
public function testConvenienceScopedLogging() { public function testConvenienceScopedLogging() {
if (file_exists(LOGS . 'shops.log')) { if (file_exists(LOGS . 'shops.log')) {
@ -570,6 +587,8 @@ class CakeLogTest extends CakeTestCase {
/** /**
* test convenience methods * test convenience methods
*
* @return void
*/ */
public function testConvenienceMethods() { public function testConvenienceMethods() {
$this->_deleteLogs(); $this->_deleteLogs();
@ -644,6 +663,8 @@ class CakeLogTest extends CakeTestCase {
/** /**
* test levels customization * test levels customization
*
* @return void
*/ */
public function testLevelCustomization() { public function testLevelCustomization() {
$this->skipIf(DIRECTORY_SEPARATOR === '\\', 'Log level tests not supported on Windows.'); $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 * Test writing log files with custom levels
*
* @return void
*/ */
public function testCustomLevelWrites() { public function testCustomLevelWrites() {
$this->_deleteLogs(); $this->_deleteLogs();

View file

@ -73,6 +73,8 @@ class ConsoleLogTest extends CakeTestCase {
/** /**
* Test writing to ConsoleOutput * Test writing to ConsoleOutput
*
* @return void
*/ */
public function testConsoleOutputWrites() { public function testConsoleOutputWrites() {
TestCakeLog::config('test_console_log', array( TestCakeLog::config('test_console_log', array(
@ -92,6 +94,8 @@ class ConsoleLogTest extends CakeTestCase {
/** /**
* Test logging to both ConsoleLog and FileLog * Test logging to both ConsoleLog and FileLog
*
* @return void
*/ */
public function testCombinedLogWriting() { public function testCombinedLogWriting() {
TestCakeLog::config('test_console_log', array( TestCakeLog::config('test_console_log', array(
@ -128,6 +132,8 @@ class ConsoleLogTest extends CakeTestCase {
/** /**
* test default value of stream 'outputAs' * test default value of stream 'outputAs'
*
* @return void
*/ */
public function testDefaultOutputAs() { public function testDefaultOutputAs() {
TestCakeLog::config('test_console_log', array( TestCakeLog::config('test_console_log', array(

View file

@ -122,6 +122,7 @@ class AclUser extends CakeTestModel {
/** /**
* parentNode * parentNode
* *
* @return null
*/ */
public function parentNode() { public function parentNode() {
return null; return null;
@ -160,6 +161,7 @@ class AclPost extends CakeTestModel {
/** /**
* parentNode * parentNode
* *
* @return null
*/ */
public function parentNode() { public function parentNode() {
return null; return null;

View file

@ -43,6 +43,7 @@ class ContainableBehaviorTest extends CakeTestCase {
/** /**
* Method executed before each test * Method executed before each test
* *
* @return void
*/ */
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
@ -68,6 +69,7 @@ class ContainableBehaviorTest extends CakeTestCase {
/** /**
* Method executed after each test * Method executed after each test
* *
* @return void
*/ */
public function tearDown() { public function tearDown() {
unset($this->Article); unset($this->Article);
@ -3388,6 +3390,7 @@ class ContainableBehaviorTest extends CakeTestCase {
/** /**
* testResetAddedAssociation method * testResetAddedAssociation method
* *
* @return void
*/ */
public function testResetAddedAssociation() { public function testResetAddedAssociation() {
$this->assertTrue(empty($this->Article->hasMany['ArticlesTag'])); $this->assertTrue(empty($this->Article->hasMany['ArticlesTag']));
@ -3429,6 +3432,7 @@ class ContainableBehaviorTest extends CakeTestCase {
/** /**
* testResetAssociation method * testResetAssociation method
* *
* @return void
*/ */
public function testResetAssociation() { public function testResetAssociation() {
$this->Article->Behaviors->load('Containable'); $this->Article->Behaviors->load('Containable');
@ -3460,6 +3464,7 @@ class ContainableBehaviorTest extends CakeTestCase {
/** /**
* testResetDeeperHasOneAssociations method * testResetDeeperHasOneAssociations method
* *
* @return void
*/ */
public function testResetDeeperHasOneAssociations() { public function testResetDeeperHasOneAssociations() {
$this->Article->User->unbindModel(array( $this->Article->User->unbindModel(array(
@ -3520,6 +3525,7 @@ class ContainableBehaviorTest extends CakeTestCase {
/** /**
* testResetMultipleHabtmAssociations method * testResetMultipleHabtmAssociations method
* *
* @return void
*/ */
public function testResetMultipleHabtmAssociations() { public function testResetMultipleHabtmAssociations() {
$articleHabtm = array( $articleHabtm = array(
@ -3610,6 +3616,8 @@ class ContainableBehaviorTest extends CakeTestCase {
/** /**
* test that bindModel and unbindModel work with find() calls in between. * test that bindModel and unbindModel work with find() calls in between.
*
* @return void
*/ */
public function testBindMultipleTimesWithFind() { public function testBindMultipleTimesWithFind() {
$binding = array( $binding = array(

View file

@ -416,6 +416,8 @@ class TranslateBehaviorTest extends CakeTestCase {
/** /**
* Test loading fields with 0 as the translated value. * Test loading fields with 0 as the translated value.
*
* @return void
*/ */
public function testFetchTranslationsWithZero() { public function testFetchTranslationsWithZero() {
$this->loadFixtures('Translate', 'TranslatedItem'); $this->loadFixtures('Translate', 'TranslatedItem');

View file

@ -476,6 +476,7 @@ class BehaviorCollectionTest extends CakeTestCase {
/** /**
* Test load() with enabled => false * Test load() with enabled => false
* *
* @return void
*/ */
public function testLoadDisabled() { public function testLoadDisabled() {
$Apple = new Apple(); $Apple = new Apple();
@ -488,6 +489,8 @@ class BehaviorCollectionTest extends CakeTestCase {
/** /**
* Tests loading aliased behaviors * Tests loading aliased behaviors
*
* @return void
*/ */
public function testLoadAlias() { public function testLoadAlias() {
$Apple = new Apple(); $Apple = new Apple();
@ -1189,6 +1192,8 @@ class BehaviorCollectionTest extends CakeTestCase {
/** /**
* Test that behavior priority * Test that behavior priority
*
* @return void
*/ */
public function testBehaviorOrderCallbacks() { public function testBehaviorOrderCallbacks() {
$model = ClassRegistry::init('Orangutan'); $model = ClassRegistry::init('Orangutan');

View file

@ -58,6 +58,7 @@ class MysqlTest extends CakeTestCase {
/** /**
* Sets up a Dbo class instance for testing * Sets up a Dbo class instance for testing
* *
* @return void
*/ */
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
@ -73,6 +74,7 @@ class MysqlTest extends CakeTestCase {
/** /**
* Sets up a Dbo class instance for testing * Sets up a Dbo class instance for testing
* *
* @return void
*/ */
public function tearDown() { public function tearDown() {
parent::tearDown(); parent::tearDown();
@ -85,6 +87,7 @@ class MysqlTest extends CakeTestCase {
* Test Dbo value method * Test Dbo value method
* *
* @group quoting * @group quoting
* @return void
*/ */
public function testQuoting() { public function testQuoting() {
$result = $this->Dbo->fields($this->model); $result = $this->Dbo->fields($this->model);

View file

@ -211,6 +211,7 @@ class PostgresTest extends CakeTestCase {
/** /**
* Sets up a Dbo class instance for testing * Sets up a Dbo class instance for testing
* *
* @return void
*/ */
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
@ -224,6 +225,7 @@ class PostgresTest extends CakeTestCase {
/** /**
* Sets up a Dbo class instance for testing * Sets up a Dbo class instance for testing
* *
* @return void
*/ */
public function tearDown() { public function tearDown() {
parent::tearDown(); parent::tearDown();
@ -234,6 +236,7 @@ class PostgresTest extends CakeTestCase {
/** /**
* Test field quoting method * Test field quoting method
* *
* @return void
*/ */
public function testFieldQuoting() { public function testFieldQuoting() {
$fields = array( $fields = array(

View file

@ -89,6 +89,7 @@ class SqliteTest extends CakeTestCase {
/** /**
* Sets up a Dbo class instance for testing * Sets up a Dbo class instance for testing
* *
* @return void
*/ */
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
@ -102,6 +103,7 @@ class SqliteTest extends CakeTestCase {
/** /**
* Sets up a Dbo class instance for testing * Sets up a Dbo class instance for testing
* *
* @return void
*/ */
public function tearDown() { public function tearDown() {
parent::tearDown(); parent::tearDown();
@ -111,6 +113,7 @@ class SqliteTest extends CakeTestCase {
/** /**
* Tests that SELECT queries from DboSqlite::listSources() are not cached * Tests that SELECT queries from DboSqlite::listSources() are not cached
* *
* @return void
*/ */
public function testTableListCacheDisabling() { public function testTableListCacheDisabling() {
$this->assertFalse(in_array('foo_test', $this->Dbo->listSources())); $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 * Tests that cached table descriptions are saved under the sanitized key name
* *
* @return void
*/ */
public function testCacheKeyName() { public function testCacheKeyName() {
Configure::write('Cache.disable', false); Configure::write('Cache.disable', false);

View file

@ -262,6 +262,7 @@ class SqlserverTest extends CakeTestCase {
/** /**
* Sets up a Dbo class instance for testing * Sets up a Dbo class instance for testing
* *
* @return void
*/ */
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();

View file

@ -998,6 +998,8 @@ class DboSourceTest extends CakeTestCase {
/** /**
* Test getting the last error. * Test getting the last error.
*
* @return void
*/ */
public function testLastError() { public function testLastError() {
$stmt = $this->getMock('PDOStatement'); $stmt = $this->getMock('PDOStatement');

View file

@ -29,6 +29,8 @@ class DboMock extends DboSource {
/** /**
* Returns the $field without modifications * Returns the $field without modifications
*
* @return string
*/ */
public function name($field) { public function name($field) {
return $field; return $field;
@ -36,6 +38,8 @@ class DboMock extends DboSource {
/** /**
* Returns true to fake a database connection * Returns true to fake a database connection
*
* @return boolean true
*/ */
public function connect() { public function connect() {
return true; 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 * 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, * NOTE: When testing on MySQL, you must set 'persistent' => false on *both* database connections,
* or one connection will step on the other. * or one connection will step on the other.
*
* @return void
*/ */
public function testCrossDatabaseJoins() { public function testCrossDatabaseJoins() {
$config = ConnectionManager::enumConnectionObjects(); $config = ConnectionManager::enumConnectionObjects();

View file

@ -7831,6 +7831,7 @@ class ModelReadTest extends BaseModelTest {
* Test correct fetching of virtual fields * Test correct fetching of virtual fields
* currently is not possible to do Relation.virtualField * currently is not possible to do Relation.virtualField
* *
* @return void
*/ */
public function testVirtualFieldsMysql() { public function testVirtualFieldsMysql() {
$this->skipIf(!($this->db instanceof Mysql), 'The rest of virtualFields test only compatible with Mysql.'); $this->skipIf(!($this->db instanceof Mysql), 'The rest of virtualFields test only compatible with Mysql.');

View file

@ -2078,7 +2078,7 @@ class ModelValidationTest extends BaseModelTest {
/** /**
* testValidateFirstWithDefaults method * testValidateFirstWithDefaults method
* *
* return @void * @return void
*/ */
public function testFirstWithDefaults() { public function testFirstWithDefaults() {
$this->loadFixtures('Article', 'Tag', 'Comment', 'User', 'ArticlesTag'); $this->loadFixtures('Article', 'Tag', 'Comment', 'User', 'ArticlesTag');

View file

@ -40,6 +40,7 @@ class TestAuthor extends Author {
* Helper method to set a datasource object * Helper method to set a datasource object
* *
* @param Object $object The datasource object * @param Object $object The datasource object
* @return void
*/ */
public function setDataSourceObject($object) { public function setDataSourceObject($object) {
$this->_dataSourceObject = $object; $this->_dataSourceObject = $object;
@ -77,6 +78,7 @@ class TestPost extends Post {
* Helper method to set a datasource object * Helper method to set a datasource object
* *
* @param Object $object The datasource object * @param Object $object The datasource object
* @return void
*/ */
public function setDataSourceObject($object) { public function setDataSourceObject($object) {
$this->_dataSourceObject = $object; $this->_dataSourceObject = $object;
@ -365,6 +367,8 @@ class ModelWriteTest extends BaseModelTest {
/** /**
* test that save() resets whitelist on failed save * test that save() resets whitelist on failed save
*
* @return void
*/ */
public function testSaveFieldListResetsWhitelistOnFailedSave() { public function testSaveFieldListResetsWhitelistOnFailedSave() {
$this->loadFixtures('Bidding'); $this->loadFixtures('Bidding');
@ -6784,7 +6788,7 @@ class ModelWriteTest extends BaseModelTest {
/** /**
* testSaveAllFieldListHasMany method * testSaveAllFieldListHasMany method
* *
* return @void * @return void
*/ */
public function testSaveAllFieldListHasMany() { public function testSaveAllFieldListHasMany() {
$this->loadFixtures('Article', 'Comment'); $this->loadFixtures('Article', 'Comment');
@ -6971,7 +6975,7 @@ class ModelWriteTest extends BaseModelTest {
/** /**
* testSaveAllDeepFieldListHasMany method * testSaveAllDeepFieldListHasMany method
* *
* return @void * @return void
*/ */
public function testSaveAllDeepFieldListHasMany() { public function testSaveAllDeepFieldListHasMany() {
$this->loadFixtures('Article', 'Comment', 'User'); $this->loadFixtures('Article', 'Comment', 'User');
@ -7014,7 +7018,7 @@ class ModelWriteTest extends BaseModelTest {
/** /**
* testSaveAllDeepHasManyBelongsTo method * testSaveAllDeepHasManyBelongsTo method
* *
* return @void * @return void
*/ */
public function testSaveAllDeepHasManyBelongsTo() { public function testSaveAllDeepHasManyBelongsTo() {
$this->loadFixtures('Article', 'Comment', 'User'); $this->loadFixtures('Article', 'Comment', 'User');
@ -7066,7 +7070,7 @@ class ModelWriteTest extends BaseModelTest {
/** /**
* testSaveAllDeepHasManyhasMany method * testSaveAllDeepHasManyhasMany method
* *
* return @void * @return void
*/ */
public function testSaveAllDeepHasManyHasMany() { public function testSaveAllDeepHasManyHasMany() {
$this->loadFixtures('Article', 'Comment', 'User', 'Attachment'); $this->loadFixtures('Article', 'Comment', 'User', 'Attachment');
@ -7122,7 +7126,7 @@ class ModelWriteTest extends BaseModelTest {
/** /**
* testSaveAllDeepOrderHasManyHasMany method * testSaveAllDeepOrderHasManyHasMany method
* *
* return @void * @return void
*/ */
public function testSaveAllDeepOrderHasManyHasMany() { public function testSaveAllDeepOrderHasManyHasMany() {
$this->loadFixtures('Article', 'Comment', 'User', 'Attachment'); $this->loadFixtures('Article', 'Comment', 'User', 'Attachment');
@ -7159,7 +7163,7 @@ class ModelWriteTest extends BaseModelTest {
/** /**
* testSaveAllDeepEmptyHasManyHasMany method * testSaveAllDeepEmptyHasManyHasMany method
* *
* return @void * @return void
*/ */
public function testSaveAllDeepEmptyHasManyHasMany() { public function testSaveAllDeepEmptyHasManyHasMany() {
$this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.'); $this->skipIf(!$this->db instanceof Mysql, 'This test is only compatible with Mysql.');
@ -7197,7 +7201,7 @@ class ModelWriteTest extends BaseModelTest {
/** /**
* testUpdateAllBoolean * testUpdateAllBoolean
* *
* return @void * @return void
*/ */
public function testUpdateAllBoolean() { public function testUpdateAllBoolean() {
$this->loadFixtures('Item', 'Syfile', 'Portfolio', 'Image', 'ItemsPortfolio'); $this->loadFixtures('Item', 'Syfile', 'Portfolio', 'Image', 'ItemsPortfolio');
@ -7212,7 +7216,7 @@ class ModelWriteTest extends BaseModelTest {
/** /**
* testUpdateAllBooleanConditions * testUpdateAllBooleanConditions
* *
* return @void * @return void
*/ */
public function testUpdateAllBooleanConditions() { public function testUpdateAllBooleanConditions() {
$this->loadFixtures('Item', 'Syfile', 'Portfolio', 'Image', 'ItemsPortfolio'); $this->loadFixtures('Item', 'Syfile', 'Portfolio', 'Image', 'ItemsPortfolio');
@ -7229,7 +7233,7 @@ class ModelWriteTest extends BaseModelTest {
/** /**
* testUpdateBoolean * testUpdateBoolean
* *
* return @void * @return void
*/ */
public function testUpdateBoolean() { public function testUpdateBoolean() {
$this->loadFixtures('Item', 'Syfile', 'Portfolio', 'Image', 'ItemsPortfolio'); $this->loadFixtures('Item', 'Syfile', 'Portfolio', 'Image', 'ItemsPortfolio');

View file

@ -929,6 +929,10 @@ class Post extends CakeTestModel {
*/ */
public $belongsTo = array('Author'); public $belongsTo = array('Author');
/**
* @param array $queryData
* @return boolean true
*/
public function beforeFind($queryData) { public function beforeFind($queryData) {
if (isset($queryData['connection'])) { if (isset($queryData['connection'])) {
$this->useDbConfig = $queryData['connection']; $this->useDbConfig = $queryData['connection'];
@ -936,6 +940,11 @@ class Post extends CakeTestModel {
return true; return true;
} }
/**
* @param array $results
* @param boolean $primary
* @return array $results
*/
public function afterFind($results, $primary = false) { public function afterFind($results, $primary = false) {
$this->useDbConfig = 'test'; $this->useDbConfig = 'test';
return $results; return $results;
@ -2763,6 +2772,11 @@ class AfterTree extends NumberTree {
*/ */
public $actsAs = array('Tree'); public $actsAs = array('Tree');
/**
* @param boolean $created
* @param array $options
* @return void
*/
public function afterSave($created, $options = array()) { public function afterSave($created, $options = array()) {
if ($created && isset($this->data['AfterTree'])) { if ($created && isset($this->data['AfterTree'])) {
$this->data['AfterTree']['name'] = 'Six and One Half Changed in AfterTree::afterSave() but not in database'; $this->data['AfterTree']['name'] = 'Six and One Half Changed in AfterTree::afterSave() but not in database';

View file

@ -612,6 +612,8 @@ class CakeRequestTest extends CakeTestCase {
/** /**
* Test that files in the 0th index work. * Test that files in the 0th index work.
*
* @return void
*/ */
public function testFilesZeroithIndex() { public function testFilesZeroithIndex() {
$_FILES = array( $_FILES = array(
@ -1303,6 +1305,7 @@ class CakeRequestTest extends CakeTestCase {
* - index.php/bananas/eat/tasty_banana * - index.php/bananas/eat/tasty_banana
* *
* @link https://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/3318 * @link https://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/3318
* @return void
*/ */
public function testBaseUrlWithModRewriteAndIndexPhp() { public function testBaseUrlWithModRewriteAndIndexPhp() {
$_SERVER['REQUEST_URI'] = '/cakephp/app/webroot/index.php'; $_SERVER['REQUEST_URI'] = '/cakephp/app/webroot/index.php';

View file

@ -47,6 +47,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the request object constructor * Tests the request object constructor
* *
* @return void
*/ */
public function testConstruct() { public function testConstruct() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -86,6 +87,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the body method * Tests the body method
* *
* @return void
*/ */
public function testBody() { public function testBody() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -98,6 +100,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the charset method * Tests the charset method
* *
* @return void
*/ */
public function testCharset() { public function testCharset() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -111,6 +114,7 @@ class CakeResponseTest extends CakeTestCase {
* Tests the statusCode method * Tests the statusCode method
* *
* @expectedException CakeException * @expectedException CakeException
* @return void
*/ */
public function testStatusCode() { public function testStatusCode() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -126,6 +130,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the type method * Tests the type method
* *
* @return void
*/ */
public function testType() { public function testType() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -148,6 +153,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the header method * Tests the header method
* *
* @return void
*/ */
public function testHeader() { public function testHeader() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -196,6 +202,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the send method * Tests the send method
* *
* @return void
*/ */
public function testSend() { public function testSend() {
$response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', '_setCookies')); $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 * Tests the send method and changing the content type
*
* @dataProvider charsetTypeProvider * @dataProvider charsetTypeProvider
* @return void
*/ */
public function testSendChangingContentType($original, $expected) { public function testSendChangingContentType($original, $expected) {
$response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', '_setCookies')); $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 * Tests the send method and changing the content type to JS without adding the charset
* *
* @return void
*/ */
public function testSendChangingContentTypeWithoutCharset() { public function testSendChangingContentTypeWithoutCharset() {
$response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', '_setCookies')); $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 * Tests the send method and changing the content type
* *
* @return void
*/ */
public function testSendWithLocation() { public function testSendWithLocation() {
$response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', '_setCookies')); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent', '_setCookies'));
@ -299,6 +310,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the disableCache method * Tests the disableCache method
* *
* @return void
*/ */
public function testDisableCache() { public function testDisableCache() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -314,6 +326,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the cache method * Tests the cache method
* *
* @return void
*/ */
public function testCache() { public function testCache() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -386,6 +399,7 @@ class CakeResponseTest extends CakeTestCase {
* Tests the httpCodes method * Tests the httpCodes method
* *
* @expectedException CakeException * @expectedException CakeException
* @return void
*/ */
public function testHttpCodes() { public function testHttpCodes() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -430,6 +444,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the download method * Tests the download method
* *
* @return void
*/ */
public function testDownload() { public function testDownload() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -443,6 +458,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the mapType method * Tests the mapType method
* *
* @return void
*/ */
public function testMapType() { public function testMapType() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -459,6 +475,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the outputCompressed method * Tests the outputCompressed method
* *
* @return void
*/ */
public function testOutputCompressed() { public function testOutputCompressed() {
$response = new CakeResponse(); $response = new CakeResponse();
@ -496,6 +513,7 @@ class CakeResponseTest extends CakeTestCase {
/** /**
* Tests the send and setting of Content-Length * Tests the send and setting of Content-Length
* *
* @return void
*/ */
public function testSendContentLength() { public function testSendContentLength() {
$response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent')); $response = $this->getMock('CakeResponse', array('_sendHeader', '_sendContent'));

View file

@ -118,7 +118,7 @@ class CakeSocketTest extends CakeTestCase {
* *
* @dataProvider invalidConnections * @dataProvider invalidConnections
* @expectedException SocketException * @expectedException SocketException
* return void * @return void
*/ */
public function testInvalidConnection($data) { public function testInvalidConnection($data) {
$this->Socket->config = array_merge($this->Socket->config, $data); $this->Socket->config = array_merge($this->Socket->config, $data);

View file

@ -42,6 +42,7 @@ class TestCakeEmail extends CakeEmail {
/** /**
* Wrap to protected method * Wrap to protected method
* *
* @return array
*/ */
public function formatAddress($address) { public function formatAddress($address) {
return parent::_formatAddress($address); return parent::_formatAddress($address);
@ -50,6 +51,7 @@ class TestCakeEmail extends CakeEmail {
/** /**
* Wrap to protected method * Wrap to protected method
* *
* @return array
*/ */
public function wrap($text, $length = CakeEmail::LINE_LENGTH_MUST) { public function wrap($text, $length = CakeEmail::LINE_LENGTH_MUST) {
return parent::_wrap($text, $length); return parent::_wrap($text, $length);
@ -67,6 +69,7 @@ class TestCakeEmail extends CakeEmail {
/** /**
* Encode to protected method * Encode to protected method
* *
* @return string
*/ */
public function encode($text) { public function encode($text) {
return $this->_encode($text); return $this->_encode($text);
@ -75,6 +78,7 @@ class TestCakeEmail extends CakeEmail {
/** /**
* Render to protected method * Render to protected method
* *
* @return array
*/ */
public function render($content) { public function render($content) {
return $this->_render($content); return $this->_render($content);
@ -82,7 +86,7 @@ class TestCakeEmail extends CakeEmail {
} }
/* /**
* EmailConfig class * EmailConfig class
* *
*/ */
@ -91,7 +95,7 @@ class TestEmailConfig {
/** /**
* test config * test config
* *
* @var string * @var array
*/ */
public $test = array( public $test = array(
'from' => array('some@example.com' => 'My website'), 'from' => array('some@example.com' => 'My website'),
@ -105,7 +109,7 @@ class TestEmailConfig {
/** /**
* test config 2 * test config 2
* *
* @var string * @var array
*/ */
public $test2 = array( public $test2 = array(
'from' => array('some@example.com' => 'My website'), 'from' => array('some@example.com' => 'My website'),
@ -118,7 +122,7 @@ class TestEmailConfig {
} }
/* /**
* ExtendTransport class * ExtendTransport class
* test class to ensure the class has send() method * 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 * Tests that it is possible set custom email validation
*
* @return void
*/ */
public function testCustomEmailValidation() { public function testCustomEmailValidation() {
$regex = '/^[\.a-z0-9!#$%&\'*+\/=?^_`{|}~-]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]{2,6}$/i'; $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( App::build(array(
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS) 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
)); ));
CakePlugin::load('TestPlugin'); CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$this->CakeEmail->reset(); $this->CakeEmail->reset();
$this->CakeEmail->transport('debug'); $this->CakeEmail->transport('debug');
@ -1490,6 +1496,14 @@ class CakeEmailTest extends CakeTestCase {
$this->assertContains('Into TestPlugin.', $result['message']); $this->assertContains('Into TestPlugin.', $result['message']);
$this->assertContains('This email was sent using the 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 // test plugin template overridden by theme
$this->CakeEmail->theme('TestTheme'); $this->CakeEmail->theme('TestTheme');
$result = $this->CakeEmail->send(); $result = $this->CakeEmail->send();
@ -2054,6 +2068,8 @@ class CakeEmailTest extends CakeTestCase {
* Tests for compatible check. * Tests for compatible check.
* charset property and charset() method. * charset property and charset() method.
* headerCharset property and headerCharset() method. * headerCharset property and headerCharset() method.
*
* @return void
*/ */
public function testCharsetsCompatible() { public function testCharsetsCompatible() {
$this->skipIf(!function_exists('mb_convert_encoding')); $this->skipIf(!function_exists('mb_convert_encoding'));
@ -2105,6 +2121,11 @@ class CakeEmailTest extends CakeTestCase {
$this->assertSame($oldStyleHeaders['Subject'], $newStyleHeaders['Subject']); $this->assertSame($oldStyleHeaders['Subject'], $newStyleHeaders['Subject']);
} }
/**
* @param mixed $charset
* @param mixed $headerCharset
* @return CakeEmail
*/
protected function _getEmailByOldStyleCharset($charset, $headerCharset) { protected function _getEmailByOldStyleCharset($charset, $headerCharset) {
$email = new CakeEmail(array('transport' => 'Debug')); $email = new CakeEmail(array('transport' => 'Debug'));
@ -2124,6 +2145,11 @@ class CakeEmailTest extends CakeTestCase {
return $email; return $email;
} }
/**
* @param mixed $charset
* @param mixed $headerCharset
* @return CakeEmail
*/
protected function _getEmailByNewStyleCharset($charset, $headerCharset) { protected function _getEmailByNewStyleCharset($charset, $headerCharset) {
$email = new CakeEmail(array('transport' => 'Debug')); $email = new CakeEmail(array('transport' => 'Debug'));
@ -2143,6 +2169,11 @@ class CakeEmailTest extends CakeTestCase {
return $email; return $email;
} }
/**
* testWrapLongLine()
*
* @return void
*/
public function testWrapLongLine() { public function testWrapLongLine() {
$message = '<a href="http://cakephp.org">' . str_repeat('x', CakeEmail::LINE_LENGTH_MUST) . "</a>"; $message = '<a href="http://cakephp.org">' . str_repeat('x', CakeEmail::LINE_LENGTH_MUST) . "</a>";
@ -2183,6 +2214,11 @@ class CakeEmailTest extends CakeTestCase {
$this->assertLineLengths($result['message']); $this->assertLineLengths($result['message']);
} }
/**
* testWrapWithTagsAcrossLines()
*
* @return void
*/
public function testWrapWithTagsAcrossLines() { public function testWrapWithTagsAcrossLines() {
$str = <<<HTML $str = <<<HTML
<table> <table>
@ -2207,6 +2243,11 @@ HTML;
$this->assertLineLengths($result['message']); $this->assertLineLengths($result['message']);
} }
/**
* CakeEmailTest::testWrapIncludeLessThanSign()
*
* @return void
*/
public function testWrapIncludeLessThanSign() { public function testWrapIncludeLessThanSign() {
$str = 'foo<bar'; $str = 'foo<bar';
$length = strlen($str); $length = strlen($str);
@ -2225,6 +2266,11 @@ HTML;
$this->assertLineLengths($result['message']); $this->assertLineLengths($result['message']);
} }
/**
* CakeEmailTest::testWrapForJapaneseEncoding()
*
* @return void
*/
public function testWrapForJapaneseEncoding() { public function testWrapForJapaneseEncoding() {
$this->skipIf(!function_exists('mb_convert_encoding')); $this->skipIf(!function_exists('mb_convert_encoding'));

View file

@ -355,7 +355,7 @@ class HttpResponseTest extends CakeTestCase {
* *
* @dataProvider invalidParseResponseDataProvider * @dataProvider invalidParseResponseDataProvider
* @expectedException SocketException * @expectedException SocketException
* return void * @return void
*/ */
public function testInvalidParseResponseData($value) { public function testInvalidParseResponseData($value) {
$this->HttpResponse->parseResponse($value); $this->HttpResponse->parseResponse($value);

View file

@ -462,6 +462,8 @@ class TestCachedPagesController extends Controller {
/** /**
* Test cached views with themes. * Test cached views with themes.
*
* @return void
*/ */
public function themed() { public function themed() {
$this->cacheAction = 10; $this->cacheAction = 10;

View file

@ -2410,6 +2410,8 @@ class RouterTest extends CakeTestCase {
/** /**
* test using custom route class in PluginDot notation * test using custom route class in PluginDot notation
*
* @return void
*/ */
public function testUsingCustomRouteClassPluginDotSyntax() { public function testUsingCustomRouteClassPluginDotSyntax() {
App::build(array( App::build(array(
@ -2572,6 +2574,8 @@ class RouterTest extends CakeTestCase {
/** /**
* Test that Router::url() uses the first request * Test that Router::url() uses the first request
*
* @return void
*/ */
public function testUrlWithRequestAction() { public function testUrlWithRequestAction() {
$firstRequest = new CakeRequest('/posts/index'); $firstRequest = new CakeRequest('/posts/index');

View file

@ -35,6 +35,11 @@ class CakeTestCaseTest extends CakeTestCase {
*/ */
public $fixtures = array('core.post', 'core.author', 'core.test_plugin_comment'); public $fixtures = array('core.post', 'core.author', 'core.test_plugin_comment');
/**
* CakeTestCaseTest::setUpBeforeClass()
*
* @return void
*/
public static function setUpBeforeClass() { public static function setUpBeforeClass() {
require_once CAKE . 'Test' . DS . 'Fixture' . DS . 'AssertTagsTestCase.php'; require_once CAKE . 'Test' . DS . 'Fixture' . DS . 'AssertTagsTestCase.php';
require_once CAKE . 'Test' . DS . 'Fixture' . DS . 'FixturizedTestCase.php'; require_once CAKE . 'Test' . DS . 'Fixture' . DS . 'FixturizedTestCase.php';

View file

@ -145,6 +145,8 @@ class ControllerTestCaseTest extends CakeTestCase {
/** /**
* Test that ControllerTestCase::generate() creates mock objects correctly * Test that ControllerTestCase::generate() creates mock objects correctly
*
* @return void
*/ */
public function testGenerate() { public function testGenerate() {
if (defined('APP_CONTROLLER_EXISTS')) { if (defined('APP_CONTROLLER_EXISTS')) {
@ -210,6 +212,8 @@ class ControllerTestCaseTest extends CakeTestCase {
/** /**
* testGenerateWithComponentConfig * testGenerateWithComponentConfig
*
* @return void
*/ */
public function testGenerateWithComponentConfig() { public function testGenerateWithComponentConfig() {
$Tests = $this->Case->generate('TestConfigs', array( $Tests = $this->Case->generate('TestConfigs', array(
@ -232,6 +236,8 @@ class ControllerTestCaseTest extends CakeTestCase {
/** /**
* Tests ControllerTestCase::generate() using classes from plugins * Tests ControllerTestCase::generate() using classes from plugins
*
* @return void
*/ */
public function testGenerateWithPlugin() { public function testGenerateWithPlugin() {
$Tests = $this->Case->generate('TestPlugin.Tests', array( $Tests = $this->Case->generate('TestPlugin.Tests', array(
@ -266,6 +272,8 @@ class ControllerTestCaseTest extends CakeTestCase {
/** /**
* Tests testAction * Tests testAction
*
* @return void
*/ */
public function testTestAction() { public function testTestAction() {
$Controller = $this->Case->generate('TestsApps'); $Controller = $this->Case->generate('TestsApps');
@ -327,6 +335,7 @@ class ControllerTestCaseTest extends CakeTestCase {
* Tests not using loaded routes during tests * Tests not using loaded routes during tests
* *
* @expectedException MissingActionException * @expectedException MissingActionException
* @return void
*/ */
public function testSkipRoutes() { public function testSkipRoutes() {
Router::connect('/:controller/:action/*'); Router::connect('/:controller/:action/*');
@ -338,6 +347,8 @@ class ControllerTestCaseTest extends CakeTestCase {
/** /**
* Tests backwards compatibility with setting the return type * Tests backwards compatibility with setting the return type
*
* @return void
*/ */
public function testBCSetReturn() { public function testBCSetReturn() {
$this->Case->autoMock = true; $this->Case->autoMock = true;
@ -367,6 +378,8 @@ class ControllerTestCaseTest extends CakeTestCase {
/** /**
* Tests sending POST data to testAction * Tests sending POST data to testAction
*
* @return void
*/ */
public function testTestActionPostData() { public function testTestActionPostData() {
$this->Case->autoMock = true; $this->Case->autoMock = true;
@ -409,6 +422,8 @@ class ControllerTestCaseTest extends CakeTestCase {
/** /**
* Tests sending GET data to testAction * Tests sending GET data to testAction
*
* @return void
*/ */
public function testTestActionGetData() { public function testTestActionGetData() {
$this->Case->autoMock = true; $this->Case->autoMock = true;
@ -465,6 +480,8 @@ class ControllerTestCaseTest extends CakeTestCase {
/** /**
* Tests autoMock ability * Tests autoMock ability
*
* @return void
*/ */
public function testAutoMock() { public function testAutoMock() {
$this->Case->autoMock = true; $this->Case->autoMock = true;
@ -478,6 +495,8 @@ class ControllerTestCaseTest extends CakeTestCase {
/** /**
* Test using testAction and not mocking * Test using testAction and not mocking
*
* @return void
*/ */
public function testNoMocking() { public function testNoMocking() {
$result = $this->Case->testAction('/tests_apps/some_method'); $result = $this->Case->testAction('/tests_apps/some_method');

View file

@ -268,6 +268,7 @@ class ClassRegistryTest extends CakeTestCase {
/** /**
* Tests prefixed datasource names for test purposes * Tests prefixed datasource names for test purposes
* *
* @return void
*/ */
public function testPrefixedTestDatasource() { public function testPrefixedTestDatasource() {
ClassRegistry::config(array('testing' => true)); 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 * Tests that passing the string parameter to init() will return false if the model does not exists
* *
* @return void
*/ */
public function testInitStrict() { public function testInitStrict() {
$this->assertFalse(ClassRegistry::init('NonExistent', true)); $this->assertFalse(ClassRegistry::init('NonExistent', true));

View file

@ -274,6 +274,8 @@ class DebuggerTest extends CakeTestCase {
/** /**
* Test method for testing addFormat with callbacks. * Test method for testing addFormat with callbacks.
*
* @return void
*/ */
public function customFormat($error, $strings) { public function customFormat($error, $strings) {
return $error['error'] . ': I eated an error ' . $error['file']; return $error['error'] . ': I eated an error ' . $error['file'];

View file

@ -125,6 +125,8 @@ class FileTest extends CakeTestCase {
/** /**
* testPermission method * testPermission method
*
* @return void
*/ */
public function testPermission() { public function testPermission() {
$this->skipIf(DIRECTORY_SEPARATOR === '\\', 'File permissions tests not supported on Windows.'); $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'; $path = CAKE . 'Test' . DS . 'test_app' . DS . 'webroot' . DS . 'img' . DS . 'cake.power.gif';
$file = new File($path); $file = new File($path);
$expected = 'image/gif'; $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; $expected = false;
} }
$this->assertEquals($expected, $file->mime()); $this->assertEquals($expected, $file->mime());
@ -548,7 +550,7 @@ class FileTest extends CakeTestCase {
$tmpFile = TMP . 'tests' . DS . 'cakephp.file.test.tmp'; $tmpFile = TMP . 'tests' . DS . 'cakephp.file.test.tmp';
if (is_writable(dirname($tmpFile)) && (!file_exists($tmpFile) || is_writable($tmpFile))) { if (is_writable(dirname($tmpFile)) && (!file_exists($tmpFile) || is_writable($tmpFile))) {
return $tmpFile; return $tmpFile;
}; }
if ($paintSkip) { if ($paintSkip) {
$trace = debug_backtrace(); $trace = debug_backtrace();

View file

@ -174,7 +174,7 @@ class HashTest extends CakeTestCase {
/** /**
* Test get() * Test get()
* *
* return void * @return void
*/ */
public function testGet() { public function testGet() {
$data = array('abc', 'def'); $data = array('abc', 'def');
@ -920,6 +920,8 @@ class HashTest extends CakeTestCase {
/** /**
* Test that extract() + matching can hit null things. * Test that extract() + matching can hit null things.
*
* @return void
*/ */
public function testExtractMatchesNull() { public function testExtractMatchesNull() {
$data = array( $data = array(

View file

@ -44,6 +44,8 @@ class FirstGenericObject extends GenericObject {
/** /**
* A generic callback * A generic callback
*
* @return void
*/ */
public function callback() { public function callback() {
} }
@ -55,6 +57,9 @@ class FirstGenericObject extends GenericObject {
*/ */
class SecondGenericObject extends GenericObject { class SecondGenericObject extends GenericObject {
/**
* @return void
*/
public function callback() { public function callback() {
} }
@ -65,6 +70,9 @@ class SecondGenericObject extends GenericObject {
*/ */
class ThirdGenericObject extends GenericObject { class ThirdGenericObject extends GenericObject {
/**
* @return void
*/
public function callback() { public function callback() {
} }

View file

@ -1352,6 +1352,8 @@ class SetTest extends CakeTestCase {
/** /**
* Test that extract() + matching can hit null things. * Test that extract() + matching can hit null things.
*
* @return void
*/ */
public function testExtractMatchesNull() { public function testExtractMatchesNull() {
$data = array( $data = array(

View file

@ -206,7 +206,7 @@ class XmlTest extends CakeTestCase {
/** /**
* test build with a single empty tag * test build with a single empty tag
* *
* return void * @return void
*/ */
public function testBuildEmptyTag() { public function testBuildEmptyTag() {
try { try {
@ -553,6 +553,7 @@ XML;
* testFromArrayFail method * testFromArrayFail method
* *
* @dataProvider invalidArrayDataProvider * @dataProvider invalidArrayDataProvider
* @return void
*/ */
public function testFromArrayFail($value) { public function testFromArrayFail($value) {
try { try {
@ -1123,6 +1124,7 @@ XML;
* *
* @dataProvider invalidToArrayDataProvider * @dataProvider invalidToArrayDataProvider
* @expectedException XmlException * @expectedException XmlException
* @return void
*/ */
public function testToArrayFail($value) { public function testToArrayFail($value) {
Xml::toArray($value); Xml::toArray($value);

View file

@ -2288,6 +2288,7 @@ class FormHelperTest extends CakeTestCase {
/** /**
* test form->input() with time types. * test form->input() with time types.
* *
* @return void
*/ */
public function testInputTime() { public function testInputTime() {
extract($this->dateRegex); extract($this->dateRegex);
@ -8374,6 +8375,7 @@ class FormHelperTest extends CakeTestCase {
/** /**
* Test base form URL when url param is passed with multiple parameters (&) * Test base form URL when url param is passed with multiple parameters (&)
* *
* @return void
*/ */
public function testCreateQuerystringrequest() { public function testCreateQuerystringrequest() {
$encoding = strtolower(Configure::read('App.encoding')); $encoding = strtolower(Configure::read('App.encoding'));

View file

@ -1428,6 +1428,8 @@ class HtmlHelperTest extends CakeTestCase {
/** /**
* Test the array form of $startText * Test the array form of $startText
*
* @return void
*/ */
public function testGetCrumbFirstLink() { public function testGetCrumbFirstLink() {
$result = $this->Html->getCrumbList(null, 'Home'); $result = $this->Html->getCrumbList(null, 'Home');
@ -1769,6 +1771,8 @@ class HtmlHelperTest extends CakeTestCase {
/** /**
* Test the inline and block options for meta() * Test the inline and block options for meta()
*
* @return void
*/ */
public function testMetaWithBlocks() { public function testMetaWithBlocks() {
$this->View->expects($this->at(0)) $this->View->expects($this->at(0))
@ -2028,7 +2032,6 @@ class HtmlHelperTest extends CakeTestCase {
/** /**
* testCrumbList method * testCrumbList method
* *
*
* @return void * @return void
*/ */
public function testCrumbList() { public function testCrumbList() {
@ -2060,6 +2063,8 @@ class HtmlHelperTest extends CakeTestCase {
/** /**
* Test getCrumbList startText * Test getCrumbList startText
*
* @return void
*/ */
public function testCrumbListFirstLink() { public function testCrumbListFirstLink() {
$this->Html->addCrumb('First', '#first'); $this->Html->addCrumb('First', '#first');

View file

@ -69,6 +69,8 @@ class NumberHelperTest extends CakeTestCase {
/** /**
* test CakeNumber class methods are called correctly * test CakeNumber class methods are called correctly
*
* @return void
*/ */
public function testNumberHelperProxyMethodCalls() { public function testNumberHelperProxyMethodCalls() {
$methods = array( $methods = array(
@ -86,6 +88,8 @@ class NumberHelperTest extends CakeTestCase {
/** /**
* test engine override * test engine override
*
* @return void
*/ */
public function testEngineOverride() { public function testEngineOverride() {
App::build(array( App::build(array(

View file

@ -74,6 +74,8 @@ class TextHelperTest extends CakeTestCase {
/** /**
* test String class methods are called correctly * test String class methods are called correctly
*
* @return void
*/ */
public function testTextHelperProxyMethodCalls() { public function testTextHelperProxyMethodCalls() {
$methods = array( $methods = array(
@ -90,6 +92,8 @@ class TextHelperTest extends CakeTestCase {
/** /**
* test engine override * test engine override
*
* @return void
*/ */
public function testEngineOverride() { public function testEngineOverride() {
App::build(array( App::build(array(
@ -204,6 +208,8 @@ class TextHelperTest extends CakeTestCase {
/** /**
* Data provider for autoLinking * Data provider for autoLinking
*
* @return array
*/ */
public static function autoLinkProvider() { public static function autoLinkProvider() {
return array( return array(

View file

@ -78,6 +78,8 @@ class TimeHelperTest extends CakeTestCase {
/** /**
* test CakeTime class methods are called correctly * test CakeTime class methods are called correctly
*
* @return void
*/ */
public function testTimeHelperProxyMethodCalls() { public function testTimeHelperProxyMethodCalls() {
$methods = array( $methods = array(
@ -104,6 +106,8 @@ class TimeHelperTest extends CakeTestCase {
/** /**
* test engine override * test engine override
*
* @return void
*/ */
public function testEngineOverride() { public function testEngineOverride() {
App::build(array( App::build(array(

View file

@ -706,6 +706,8 @@ class ViewTest extends CakeTestCase {
/** /**
* Test that elements can have callbacks * Test that elements can have callbacks
*
* @return void
*/ */
public function testElementCallbacks() { public function testElementCallbacks() {
$Helper = $this->getMock('Helper', array(), array($this->View), 'ElementCallbackMockHtmlHelper'); $Helper = $this->getMock('Helper', array(), array($this->View), 'ElementCallbackMockHtmlHelper');

View file

@ -27,6 +27,11 @@ class TestsAppsPostsController extends AppController {
public $viewPath = 'TestsApps'; public $viewPath = 'TestsApps';
/**
* add method
*
* @return void
*/
public function add() { public function add() {
$data = array( $data = array(
'Post' => array( 'Post' => array(
@ -44,6 +49,7 @@ class TestsAppsPostsController extends AppController {
/** /**
* check URL params * check URL params
* *
* @return void
*/ */
public function url_var() { public function url_var() {
$this->set('params', $this->request->params); $this->set('params', $this->request->params);
@ -53,12 +59,18 @@ class TestsAppsPostsController extends AppController {
/** /**
* post var testing * post var testing
* *
* @return void
*/ */
public function post_var() { public function post_var() {
$this->set('data', $this->request->data); $this->set('data', $this->request->data);
$this->render('index'); $this->render('index');
} }
/**
* input_data()
*
* @return void
*/
public function input_data() { public function input_data() {
$this->set('data', $this->request->input('json_decode', true)); $this->set('data', $this->request->input('json_decode', true));
$this->render('index'); $this->render('index');
@ -67,6 +79,7 @@ class TestsAppsPostsController extends AppController {
/** /**
* Fixturized action for testAction() * Fixturized action for testAction()
* *
* @return void
*/ */
public function fixtured() { public function fixtured() {
$this->set('posts', $this->Post->find('all')); $this->set('posts', $this->Post->find('all'));

View file

@ -0,0 +1,4 @@
<?php echo $this->fetch('content'); ?>
This email was sent using TestPluginTwo.

View file

@ -57,6 +57,7 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
* *
* @param array $argv * @param array $argv
* @param boolean $exit * @param boolean $exit
* @return void
*/ */
public function run(array $argv, $exit = true) { public function run(array $argv, $exit = true) {
$this->handleArguments($argv); $this->handleArguments($argv);

View file

@ -94,6 +94,7 @@ class InterceptContentHelper extends Helper {
* Intercepts and stores the contents of the view before the layout is rendered * Intercepts and stores the contents of the view before the layout is rendered
* *
* @param string $viewFile The view file * @param string $viewFile The view file
* @return void
*/ */
public function afterRender($viewFile) { public function afterRender($viewFile) {
$this->_View->assign('__view_no_layout__', $this->_View->fetch('content')); $this->_View->assign('__view_no_layout__', $this->_View->fetch('content'));

View file

@ -47,8 +47,8 @@ class CakeTestModel extends Model {
* @param array $data * @param array $data
* @param boolean|array $validate * @param boolean|array $validate
* @param array $fieldList * @param array $fieldList
* @return void
*/ */
public function save($data = null, $validate = true, $fieldList = array()) { public function save($data = null, $validate = true, $fieldList = array()) {
$db = $this->getDataSource(); $db = $this->getDataSource();
$db->columns['datetime']['formatter'] = 'CakeTestSuiteDispatcher::date'; $db->columns['datetime']['formatter'] = 'CakeTestSuiteDispatcher::date';

View file

@ -122,6 +122,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
* Print result * Print result
* *
* @param PHPUnit_Framework_TestResult $result * @param PHPUnit_Framework_TestResult $result
* @return void
*/ */
public function printResult(PHPUnit_Framework_TestResult $result) { public function printResult(PHPUnit_Framework_TestResult $result) {
$this->paintFooter($result); $this->paintFooter($result);
@ -131,6 +132,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
* Paint result * Paint result
* *
* @param PHPUnit_Framework_TestResult $result * @param PHPUnit_Framework_TestResult $result
* @return void
*/ */
public function paintResult(PHPUnit_Framework_TestResult $result) { public function paintResult(PHPUnit_Framework_TestResult $result) {
$this->paintFooter($result); $this->paintFooter($result);
@ -142,6 +144,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
* @param PHPUnit_Framework_Test $test * @param PHPUnit_Framework_Test $test
* @param Exception $e * @param Exception $e
* @param float $time * @param float $time
* @return void
*/ */
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) { public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) {
$this->paintException($e, $test); $this->paintException($e, $test);
@ -153,6 +156,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
* @param PHPUnit_Framework_Test $test * @param PHPUnit_Framework_Test $test
* @param PHPUnit_Framework_AssertionFailedError $e * @param PHPUnit_Framework_AssertionFailedError $e
* @param float $time * @param float $time
* @return void
*/ */
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) { public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) {
$this->paintFail($e, $test); $this->paintFail($e, $test);
@ -164,6 +168,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
* @param PHPUnit_Framework_Test $test * @param PHPUnit_Framework_Test $test
* @param Exception $e * @param Exception $e
* @param float $time * @param float $time
* @return void
*/ */
public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) { public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
$this->paintSkip($e, $test); $this->paintSkip($e, $test);
@ -175,6 +180,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
* @param PHPUnit_Framework_Test $test * @param PHPUnit_Framework_Test $test
* @param Exception $e * @param Exception $e
* @param float $time * @param float $time
* @return void
*/ */
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) { public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
$this->paintSkip($e, $test); $this->paintSkip($e, $test);
@ -184,6 +190,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
* A test suite started. * A test suite started.
* *
* @param PHPUnit_Framework_TestSuite $suite * @param PHPUnit_Framework_TestSuite $suite
* @return void
*/ */
public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
if (!$this->_headerSent) { if (!$this->_headerSent) {
@ -196,6 +203,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
* A test suite ended. * A test suite ended.
* *
* @param PHPUnit_Framework_TestSuite $suite * @param PHPUnit_Framework_TestSuite $suite
* @return void
*/ */
public function endTestSuite(PHPUnit_Framework_TestSuite $suite) { public function endTestSuite(PHPUnit_Framework_TestSuite $suite) {
} }
@ -204,6 +212,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
* A test started. * A test started.
* *
* @param PHPUnit_Framework_Test $test * @param PHPUnit_Framework_Test $test
* @return void
*/ */
public function startTest(PHPUnit_Framework_Test $test) { public function startTest(PHPUnit_Framework_Test $test) {
} }
@ -213,6 +222,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
* *
* @param PHPUnit_Framework_Test $test * @param PHPUnit_Framework_Test $test
* @param float $time * @param float $time
* @return void
*/ */
public function endTest(PHPUnit_Framework_Test $test, $time) { public function endTest(PHPUnit_Framework_Test $test, $time) {
$this->numAssertions += $test->getNumAssertions(); $this->numAssertions += $test->getNumAssertions();

View file

@ -23,6 +23,7 @@ App::uses('Hash', 'Utility');
* Class used for manipulation of arrays. * Class used for manipulation of arrays.
* *
* @package Cake.Utility * @package Cake.Utility
* @deprecated Will be removed in 3.0. Use Hash instead.
*/ */
class Set { class Set {

View file

@ -236,7 +236,7 @@ if (!function_exists('pr')) {
* print_r() will wrap <PRE> tags around the output of given array. Similar to debug(). * print_r() will wrap <PRE> tags around the output of given array. Similar to debug().
* *
* @see debug() * @see debug()
* @param array $var Variable to print out * @param mixed $var Variable to print out
* @return void * @return void
* @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#pr * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#pr
*/ */