test: Add return type declarations to overridden methods of TestCase classes.

This commit is contained in:
Koji Tanaka 2022-12-28 16:03:39 +09:00 committed by Kamil Wylegala
parent 0692ce5b62
commit 75716f76bc
146 changed files with 273 additions and 273 deletions

View file

@ -34,7 +34,7 @@ class BasicsTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
App::build(array(
'Locale' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)

View file

@ -32,7 +32,7 @@ class CacheTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->_cacheDisable = Configure::read('Cache.disable');
Configure::write('Cache.disable', false);
@ -46,7 +46,7 @@ class CacheTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
Cache::drop('latest');
Cache::drop('page');

View file

@ -37,7 +37,7 @@ class ApcEngineTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$hasApc = extension_loaded('apc') || extension_loaded('apcu');
$this->skipIf(!$hasApc, 'Apc is not installed or configured properly.');
@ -60,7 +60,7 @@ class ApcEngineTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
Configure::write('Cache.disable', $this->_cacheDisable);
Cache::drop('apc');

View file

@ -37,7 +37,7 @@ class FileEngineTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Cache.disable', false);
Cache::config('file_test', array('engine' => 'File', 'path' => CACHE));
@ -48,7 +48,7 @@ class FileEngineTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
// Cache::clear(false, 'file_test');
Cache::drop('file_test');

View file

@ -54,7 +54,7 @@ class MemcacheEngineTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->skipIf(!class_exists('Memcache'), 'Memcache is not installed or configured properly.');
@ -72,7 +72,7 @@ class MemcacheEngineTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
Configure::write('Cache.disable', $this->_cacheDisable);
Cache::drop('memcache');

View file

@ -60,7 +60,7 @@ class MemcachedEngineTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->skipIf(!class_exists('Memcached'), 'Memcached is not installed or configured properly.');
@ -82,7 +82,7 @@ class MemcachedEngineTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
Cache::drop('memcached');
Cache::drop('memcached_groups');

View file

@ -31,7 +31,7 @@ class RedisEngineTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->skipIf(!class_exists('Redis'), 'Redis is not installed or configured properly.');
@ -56,7 +56,7 @@ class RedisEngineTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
Configure::write('Cache.disable', $this->_cacheDisable);
Cache::drop('');

View file

@ -30,7 +30,7 @@ class WincacheEngineTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->skipIf(!function_exists('wincache_ucache_set'), 'Wincache is not installed or configured properly.');
$this->_cacheDisable = Configure::read('Cache.disable');
@ -43,7 +43,7 @@ class WincacheEngineTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
Configure::write('Cache.disable', $this->_cacheDisable);
Cache::drop('wincache');

View file

@ -30,7 +30,7 @@ class XcacheEngineTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
if (!function_exists('xcache_set')) {
$this->markTestSkipped('Xcache is not installed or configured properly');
@ -45,7 +45,7 @@ class XcacheEngineTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
Configure::write('Cache.disable', $this->_cacheDisable);
Cache::drop('xcache');

View file

@ -50,7 +50,7 @@ class IniReaderTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS;
}

View file

@ -50,7 +50,7 @@ class PhpReaderTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS;
}

View file

@ -42,7 +42,7 @@ class AclShellTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Acl.database', 'test');
Configure::write('Acl.classname', 'DbAcl');

View file

@ -34,7 +34,7 @@ class ApiShellTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);

View file

@ -45,7 +45,7 @@ class BakeShellTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -62,7 +62,7 @@ class BakeShellTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Dispatch, $this->Shell);
}

View file

@ -49,7 +49,7 @@ class CommandListShellTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
App::build(array(
'Plugin' => array(
@ -82,7 +82,7 @@ class CommandListShellTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Shell);
CakePlugin::unload();

View file

@ -51,7 +51,7 @@ class CompletionShellTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
App::build(array(
'Plugin' => array(
@ -84,7 +84,7 @@ class CompletionShellTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Shell);
CakePlugin::unload();

View file

@ -102,7 +102,7 @@ class SchemaShellTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
@ -119,7 +119,7 @@ class SchemaShellTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
if (!empty($this->file) && $this->file instanceof File) {
$this->file->delete();

View file

@ -28,7 +28,7 @@ class CommandTaskTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
App::build(array(
'Plugin' => array(
@ -55,7 +55,7 @@ class CommandTaskTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->CommandTask);
CakePlugin::unload();

View file

@ -69,7 +69,7 @@ class ControllerTaskTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -101,7 +101,7 @@ class ControllerTaskTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
unset($this->Task);
ClassRegistry::flush();
App::build();

View file

@ -34,7 +34,7 @@ class DbConfigTaskTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -52,7 +52,7 @@ class DbConfigTaskTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Task);
}

View file

@ -37,7 +37,7 @@ class ExtractTaskTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -56,7 +56,7 @@ class ExtractTaskTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Task);

View file

@ -51,7 +51,7 @@ class FixtureTaskTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -74,7 +74,7 @@ class FixtureTaskTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Task);
}

View file

@ -49,7 +49,7 @@ class ModelTaskTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -99,7 +99,7 @@ class ModelTaskTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Task);
}

View file

@ -39,7 +39,7 @@ class PluginTaskTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$this->in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -67,7 +67,7 @@ class PluginTaskTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
if (file_exists($this->Task->bootstrap)) {
unlink($this->Task->bootstrap);
}

View file

@ -38,7 +38,7 @@ class ProjectTaskTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -55,7 +55,7 @@ class ProjectTaskTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
$Folder = new Folder($this->Task->path . 'bake_test_app');

View file

@ -36,7 +36,7 @@ class TemplateTaskTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -52,7 +52,7 @@ class TemplateTaskTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Task);
}

View file

@ -191,7 +191,7 @@ class TestTaskTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -209,7 +209,7 @@ class TestTaskTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Task);
CakePlugin::unload();

View file

@ -184,7 +184,7 @@ class ViewTaskTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -208,7 +208,7 @@ class ViewTaskTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Task, $this->Dispatch);
}

View file

@ -48,7 +48,7 @@ class TestShellTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@ -66,7 +66,7 @@ class TestShellTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Dispatch, $this->Shell);
}

View file

@ -30,7 +30,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
*
* @return Mock object
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Error = $this->getMock('ConsoleErrorHandler', array('_stop'));
ConsoleErrorHandler::$stderr = $this->getMock('ConsoleOutput', array(), array(), '', false);
@ -41,7 +41,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
unset($this->Error);
parent::tearDown();
}

View file

@ -30,7 +30,7 @@ class ConsoleOutputTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->output = $this->getMock('ConsoleOutput', array('_write'));
$this->output->outputAs(ConsoleOutput::COLOR);
@ -41,7 +41,7 @@ class ConsoleOutputTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->output);
}

View file

@ -27,7 +27,7 @@ class ProgressShellHelperTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->consoleOutput = new ConsoleOutputStub();
@ -220,4 +220,4 @@ class ProgressShellHelperTest extends CakeTestCase {
);
$this->assertEquals($expected, $this->consoleOutput->messages());
}
}
}

View file

@ -27,7 +27,7 @@ class TableShellHelperTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->consoleOutput = new ConsoleOutputStub();
@ -198,4 +198,4 @@ class TableShellHelperTest extends CakeTestCase {
);
$this->assertEquals($expected, $this->consoleOutput->messages());
}
}
}

View file

@ -109,7 +109,7 @@ class ShellDispatcherTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
App::build(array(
'Plugin' => array(
@ -127,7 +127,7 @@ class ShellDispatcherTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
CakePlugin::unload();
}

View file

@ -137,7 +137,7 @@ class ShellTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$output = $this->getMock('ConsoleOutput', array(), array(), '', false);

View file

@ -37,7 +37,7 @@ class TaskCollectionTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$shell = $this->getMock('Shell', array(), array(), '', false);
$dispatcher = $this->getMock('ShellDispatcher', array(), array(), '', false);
@ -49,7 +49,7 @@ class TaskCollectionTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
unset($this->Tasks);
parent::tearDown();
}

View file

@ -56,7 +56,7 @@ class ApplicationControllerTest extends ControllerTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
CakeSession::destroy();
parent::setUp();
}
@ -66,7 +66,7 @@ class ApplicationControllerTest extends ControllerTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
CakeSession::destroy();
parent::tearDown();
}

View file

@ -188,7 +188,7 @@ class DbAclTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Acl.classname', 'DbAclTwoTest');
Configure::write('Acl.database', 'test');
@ -201,7 +201,7 @@ class DbAclTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Acl);
}

View file

@ -32,7 +32,7 @@ class PhpAclTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Acl.classname', 'PhpAcl');
$Collection = new ComponentCollection();

View file

@ -31,7 +31,7 @@ class AclComponentTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
if (!class_exists('MockAclImplementation', false)) {
$this->getMock('AclInterface', array(), array(), 'MockAclImplementation');
@ -46,7 +46,7 @@ class AclComponentTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Acl);
}

View file

@ -34,7 +34,7 @@ class ActionsAuthorizeTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->controller = $this->getMock('Controller', array(), array(), '', false);
$this->Acl = $this->getMock('AclComponent', array(), array(), '', false);

View file

@ -41,7 +41,7 @@ class BasicAuthenticateTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Collection = $this->getMock('ComponentCollection');
$this->auth = new BasicAuthenticate($this->Collection, array(

View file

@ -39,7 +39,7 @@ class BlowfishAuthenticateTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Collection = $this->getMock('ComponentCollection');
$this->auth = new BlowfishAuthenticate($this->Collection, array(

View file

@ -33,7 +33,7 @@ class ControllerAuthorizeTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->controller = $this->getMock('Controller', array('isAuthorized'), array(), '', false);
$this->components = $this->getMock('ComponentCollection');

View file

@ -34,7 +34,7 @@ class CrudAuthorizeTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Routing.prefixes', array());
Router::reload();

View file

@ -42,7 +42,7 @@ class DigestAuthenticateTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Collection = $this->getMock('ComponentCollection');
$this->server = $_SERVER;
@ -67,7 +67,7 @@ class DigestAuthenticateTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
$_SERVER = $this->server;
}

View file

@ -41,7 +41,7 @@ class FormAuthenticateTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Collection = $this->getMock('ComponentCollection');
$this->auth = new FormAuthenticate($this->Collection, array(

View file

@ -378,7 +378,7 @@ class AuthComponentTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Security.salt', 'YJfIxfs2guVoUubWDYhG93b0qyJfIxfs2guwvniR2G0FgaC9mi');
Configure::write('Security.cipherSeed', 770011223369876);
@ -409,7 +409,7 @@ class AuthComponentTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
TestAuthComponent::clearUser();

View file

@ -69,7 +69,7 @@ class CookieComponentTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$_COOKIE = array();
$this->Controller = new CookieComponentTestController(new CakeRequest(), new CakeResponse());
@ -91,7 +91,7 @@ class CookieComponentTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
$this->Cookie->destroy();
}

View file

@ -140,7 +140,7 @@ class EmailComponentTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('App.encoding', 'UTF-8');

View file

@ -33,7 +33,7 @@ class FlashComponentTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Components = new ComponentCollection();
$this->Flash = new FlashComponent($this->Components);
@ -44,7 +44,7 @@ class FlashComponentTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
CakeSession::destroy();
}

View file

@ -298,7 +298,7 @@ class PaginatorComponentTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->request = new CakeRequest('controller_posts/index');
$this->request->params['pass'] = $this->request->params['named'] = array();

View file

@ -106,7 +106,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->_init();
}
@ -130,7 +130,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->RequestHandler, $this->Controller);
if (!headers_sent()) {

View file

@ -159,7 +159,7 @@ class SecurityComponentTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$request = $this->getMock('CakeRequest', array('here'), array('posts/index', false));
@ -183,7 +183,7 @@ class SecurityComponentTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
$this->Controller->Session->delete('_Token');
$this->Controller->Session->destroy();

View file

@ -90,7 +90,7 @@ class SessionComponentTest extends CakeTestCase {
*
* @return void
*/
public static function setupBeforeClass() {
public static function setupBeforeClass() : void {
static::$_sessionBackup = Configure::read('Session');
Configure::write('Session', array(
'defaults' => 'php',
@ -104,7 +104,7 @@ class SessionComponentTest extends CakeTestCase {
*
* @return void
*/
public static function teardownAfterClass() {
public static function teardownAfterClass() : void {
Configure::write('Session', static::$_sessionBackup);
}
@ -113,7 +113,7 @@ class SessionComponentTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$_SESSION = null;
$this->ComponentCollection = new ComponentCollection();
@ -124,7 +124,7 @@ class SessionComponentTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
CakeSession::destroy();
}

View file

@ -34,7 +34,7 @@ class ComponentCollectionTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Components = new ComponentCollection();
}
@ -44,7 +44,7 @@ class ComponentCollectionTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Components);
}

View file

@ -206,7 +206,7 @@ class ComponentTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->_pluginPaths = App::path('plugins');
App::build(array(

View file

@ -390,7 +390,7 @@ class ControllerTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
App::objects('plugin', null, false);
App::build();
@ -402,7 +402,7 @@ class ControllerTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
CakePlugin::unload();
}

View file

@ -161,7 +161,7 @@ class ScaffoldTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Config.language', 'eng');
$request = new CakeRequest(null, false);
@ -174,7 +174,7 @@ class ScaffoldTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
CakeSession::destroy();
unset($this->Controller);

View file

@ -28,7 +28,7 @@ class AppTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
CakePlugin::unload();
}
@ -848,7 +848,7 @@ class AppTest extends CakeTestCase {
}
/**
* Data provider function for testIncreaseMemoryLimit
* Data provider function for testIncreaseMemoryLimit
*
* @return void
*/

View file

@ -293,7 +293,7 @@ class ObjectTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->object = new TestCakeObject();
}
@ -303,7 +303,7 @@ class ObjectTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
CakePlugin::unload();
unset($this->object);

View file

@ -28,7 +28,7 @@ class CakePluginTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
App::build(array(
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
@ -41,7 +41,7 @@ class CakePluginTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
CakePlugin::unload();
}

View file

@ -32,7 +32,7 @@ class ConfigureTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Cache.disable', true);
App::build();
@ -44,7 +44,7 @@ class ConfigureTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
if (file_exists(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_core_paths')) {
unlink(TMP . 'cache' . DS . 'persistent' . DS . 'cake_core_core_paths');
@ -432,7 +432,7 @@ class ConfigureTest extends CakeTestCase {
*
* @return void
*/
public function testReaderSetup() {
public function testReadersetUp() {
$reader = new PhpReader();
Configure::config('test', $reader);
$configured = Configure::configured();

View file

@ -52,7 +52,7 @@ class ErrorHandlerTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
App::build(array(
'View' => array(
@ -75,7 +75,7 @@ class ErrorHandlerTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
if ($this->_restoreError) {
restore_error_handler();

View file

@ -144,7 +144,7 @@ class ExceptionRendererTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Config.language', 'eng');
App::build(array(
@ -165,7 +165,7 @@ class ExceptionRendererTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
if ($this->_restoreError) {
restore_error_handler();

View file

@ -31,7 +31,7 @@ class I18nTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Cache::delete('object_map', '_cake_core_');
@ -47,7 +47,7 @@ class I18nTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
Cache::delete('object_map', '_cake_core_');

View file

@ -30,7 +30,7 @@ class L10nTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::delete('Config.language');
}

View file

@ -31,7 +31,7 @@ class CakeLogTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$streams = CakeLog::configured();
foreach ($streams as $stream) {

View file

@ -47,7 +47,7 @@ class TestCakeLog extends CakeLog {
*/
class ConsoleLogTest extends CakeTestCase {
public function setUp() {
public function setUp() : void {
parent::setUp();
CakeLog::config('debug', array(
'engine' => 'File',
@ -61,7 +61,7 @@ class ConsoleLogTest extends CakeTestCase {
));
}
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
if (file_exists(LOGS . 'error.log')) {
unlink(LOGS . 'error.log');

View file

@ -39,7 +39,7 @@ class LogEngineCollectionTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Collection = new LogEngineCollection();

View file

@ -211,7 +211,7 @@ class AclNodeTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Acl.classname', 'TestDbAcl');
Configure::write('Acl.database', 'test');

View file

@ -202,7 +202,7 @@ class AclBehaviorTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Acl.database', 'test');
@ -215,7 +215,7 @@ class AclBehaviorTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Aro, $this->Aco);
}
@ -225,7 +225,7 @@ class AclBehaviorTest extends CakeTestCase {
*
* @return void
*/
public function testSetup() {
public function testsetUp() {
parent::setUp();
$User = new AclUser();
$this->assertTrue(isset($User->Behaviors->Acl->settings['User']));

View file

@ -45,7 +45,7 @@ class ContainableBehaviorTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->User = ClassRegistry::init('User');
$this->Article = ClassRegistry::init('Article');
@ -71,7 +71,7 @@ class ContainableBehaviorTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
unset($this->Article);
unset($this->User);
unset($this->Tag);

View file

@ -452,7 +452,7 @@ class CakeSchemaTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
ConnectionManager::getDataSource('test')->cacheSources = false;
$this->Schema = new TestAppSchema();
@ -463,7 +463,7 @@ class CakeSchemaTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
if (file_exists(TMP . 'tests' . DS . 'schema.php')) {
unlink(TMP . 'tests' . DS . 'schema.php');

View file

@ -29,7 +29,7 @@ class ConnectionManagerTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
CakePlugin::unload();
}

View file

@ -84,7 +84,7 @@ class CakeSessionTest extends CakeTestCase {
*
* @return void
*/
public static function setupBeforeClass() {
public static function setupBeforeClass() : void {
// Make sure garbage colector will be called
static::$_gcDivisor = ini_get('session.gc_divisor');
ini_set('session.gc_divisor', '1');
@ -95,7 +95,7 @@ class CakeSessionTest extends CakeTestCase {
*
* @return void
*/
public static function teardownAfterClass() {
public static function teardownAfterClass() : void {
// Revert to the default setting
ini_set('session.gc_divisor', static::$_gcDivisor);
}
@ -105,7 +105,7 @@ class CakeSessionTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Session', array(
'defaults' => 'php',
@ -121,7 +121,7 @@ class CakeSessionTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
if (TestCakeSession::started()) {
session_write_close();
}

View file

@ -107,7 +107,7 @@ class DataSourceTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Source = $this->getMock(
'TestSource',
@ -132,7 +132,7 @@ class DataSourceTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Model, $this->Source);
ConnectionManager::drop($this->sourceName);

View file

@ -60,7 +60,7 @@ class MysqlTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Dbo = ConnectionManager::getDataSource('test');
if (!($this->Dbo instanceof Mysql)) {
@ -76,7 +76,7 @@ class MysqlTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->model);
ClassRegistry::flush();

View file

@ -214,7 +214,7 @@ class PostgresTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Cache.disable', true);
$this->Dbo = ConnectionManager::getDataSource('test');
@ -228,7 +228,7 @@ class PostgresTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
Configure::write('Cache.disable', false);
unset($this->Dbo2);

View file

@ -91,7 +91,7 @@ class SqliteTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Cache.disable', true);
$this->Dbo = ConnectionManager::getDataSource('test');
@ -105,7 +105,7 @@ class SqliteTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
Configure::write('Cache.disable', false);
}

View file

@ -264,7 +264,7 @@ class SqlserverTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Dbo = ConnectionManager::getDataSource('test');
if (!($this->Dbo instanceof Sqlserver)) {
@ -279,7 +279,7 @@ class SqlserverTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Dbo);
unset($this->model);

View file

@ -184,7 +184,7 @@ class DboSourceTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->testDb = new DboTestSource();
@ -200,7 +200,7 @@ class DboSourceTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Model);
}

View file

@ -34,7 +34,7 @@ class CacheSessionTest extends CakeTestCase {
*
* @return void
*/
public static function setupBeforeClass() {
public static function setupBeforeClass() : void {
Cache::config('session_test', array(
'engine' => 'File',
'prefix' => 'session_test_'
@ -49,7 +49,7 @@ class CacheSessionTest extends CakeTestCase {
*
* @return void
*/
public static function teardownAfterClass() {
public static function teardownAfterClass() : void {
Cache::clear(false, 'session_test');
Cache::drop('session_test');
@ -61,7 +61,7 @@ class CacheSessionTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->storage = new CacheSession();
}
@ -71,7 +71,7 @@ class CacheSessionTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->storage);
}

View file

@ -53,7 +53,7 @@ class DatabaseSessionTest extends CakeTestCase {
*
* @return void
*/
public static function setupBeforeClass() {
public static function setupBeforeClass() : void {
static::$_sessionBackup = Configure::read('Session');
Configure::write('Session.handler', array(
'model' => 'SessionTestModel',
@ -66,7 +66,7 @@ class DatabaseSessionTest extends CakeTestCase {
*
* @return void
*/
public static function teardownAfterClass() {
public static function teardownAfterClass() : void {
Configure::write('Session', static::$_sessionBackup);
}
@ -75,7 +75,7 @@ class DatabaseSessionTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->storage = new DatabaseSession();
}
@ -85,7 +85,7 @@ class DatabaseSessionTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
unset($this->storage);
ClassRegistry::flush();
parent::tearDown();

View file

@ -56,7 +56,7 @@ class ModelCrossSchemaHabtmTest extends BaseModelTest {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->_checkConfigs();
}

View file

@ -81,7 +81,7 @@ abstract class BaseModelTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->debug = Configure::read('debug');
}
@ -91,7 +91,7 @@ abstract class BaseModelTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
Configure::write('debug', $this->debug);
ClassRegistry::flush();

View file

@ -30,7 +30,7 @@ class ModelValidationTest extends BaseModelTest {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Config.language', 'eng');
}

View file

@ -115,7 +115,7 @@ class ModelWriteTest extends BaseModelTest {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Config.language', 'eng');
}

View file

@ -30,7 +30,7 @@ class CakeValidationSetTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
Configure::write('Config.language', 'eng');
}

View file

@ -64,7 +64,7 @@ class CakeRequestTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->_app = Configure::read('App');
$this->_case = null;
@ -81,7 +81,7 @@ class CakeRequestTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
if (!empty($this->_case)) {
$_GET['case'] = $this->_case;

View file

@ -29,7 +29,7 @@ class CakeResponseTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
ob_start();
}
@ -39,7 +39,7 @@ class CakeResponseTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
ob_end_clean();
}

View file

@ -30,7 +30,7 @@ class CakeSocketTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Socket = new CakeSocket(array('timeout' => 1));
}
@ -40,7 +40,7 @@ class CakeSocketTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Socket);
}

View file

@ -149,7 +149,7 @@ class CakeEmailTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->_configFileExists = true;
@ -171,7 +171,7 @@ class CakeEmailTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
App::build();

View file

@ -30,7 +30,7 @@ class DebugTransportTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->DebugTransport = new DebugTransport();
}

View file

@ -30,7 +30,7 @@ class MailTransportTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->MailTransport = $this->getMock('MailTransport', array('_mail'));
$this->MailTransport->config(array('additionalParameters' => '-f'));

View file

@ -67,7 +67,7 @@ class SmtpTransportTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->socket = $this->getMock('CakeSocket', array('read', 'write', 'connect', 'enableCrypto'));

View file

@ -70,7 +70,7 @@ class DigestAuthenticationTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->HttpSocket = new DigestHttpSocket();
$this->HttpSocket->request['method'] = 'GET';
@ -82,7 +82,7 @@ class DigestAuthenticationTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->HttpSocket);
}

View file

@ -89,7 +89,7 @@ class HttpResponseTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->HttpResponse = new TestHttpResponse();
}

View file

@ -188,7 +188,7 @@ class HttpSocketTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->Socket = $this->getMock('TestHttpSocket', array('read', 'write', 'connect'));
$this->RequestSocket = $this->getMock('TestHttpSocket', array('read', 'write', 'connect', 'request'));
@ -199,7 +199,7 @@ class HttpSocketTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
unset($this->Socket, $this->RequestSocket);
}

View file

@ -543,7 +543,7 @@ class DispatcherTest extends CakeTestCase {
*
* @return void
*/
public function setUp() {
public function setUp() : void {
parent::setUp();
$this->_get = $_GET;
$_GET = array();
@ -571,7 +571,7 @@ class DispatcherTest extends CakeTestCase {
*
* @return void
*/
public function tearDown() {
public function tearDown() : void {
parent::tearDown();
$_GET = $this->_get;
$_POST = $this->_post;

Some files were not shown because too many files have changed in this diff Show more