From 1cac1846a3baffaedef29a0c96d2f6c79ec8efd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Mon, 29 Jul 2013 01:22:52 +0200 Subject: [PATCH] Added missing calls to setUp & tearDown in tests --- lib/Cake/Test/Case/Cache/Engine/RedisEngineTest.php | 2 ++ lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php | 2 ++ lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php | 1 + lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php | 2 ++ lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php | 2 ++ lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php | 2 ++ lib/Cake/Test/Case/Network/Email/DebugTransportTest.php | 1 + lib/Cake/Test/Case/Network/Email/MailTransportTest.php | 1 + lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php | 1 + lib/Cake/Test/Case/Network/Http/DigestAuthenticationTest.php | 2 ++ lib/Cake/Test/Case/Network/Http/HttpResponseTest.php | 1 + lib/Cake/Test/Case/Network/Http/HttpSocketTest.php | 2 ++ lib/Cake/Test/Case/Routing/DispatcherTest.php | 2 ++ lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php | 1 + lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php | 2 ++ lib/Cake/Test/Case/Utility/CakeTimeTest.php | 1 + lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php | 1 + 17 files changed, 26 insertions(+) diff --git a/lib/Cake/Test/Case/Cache/Engine/RedisEngineTest.php b/lib/Cake/Test/Case/Cache/Engine/RedisEngineTest.php index 5b2e5c948..30f51d5af 100644 --- a/lib/Cake/Test/Case/Cache/Engine/RedisEngineTest.php +++ b/lib/Cake/Test/Case/Cache/Engine/RedisEngineTest.php @@ -34,6 +34,7 @@ class RedisEngineTest extends CakeTestCase { * @return void */ public function setUp() { + parent::setUp(); $this->skipIf(!class_exists('Redis'), 'Redis is not installed or configured properly.'); $this->_cacheDisable = Configure::read('Cache.disable'); @@ -51,6 +52,7 @@ class RedisEngineTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); Configure::write('Cache.disable', $this->_cacheDisable); Cache::drop(''); Cache::drop('redis_groups'); diff --git a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php index aeb0e2503..ad8ddb112 100644 --- a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php @@ -72,6 +72,7 @@ class CookieComponentTest extends CakeTestCase { * @return void */ public function setUp() { + parent::setUp(); $_COOKIE = array(); $this->Controller = new CookieComponentTestController(new CakeRequest(), new CakeResponse()); $this->Controller->constructClasses(); @@ -93,6 +94,7 @@ class CookieComponentTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); $this->Cookie->destroy(); } diff --git a/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php index a971fb507..c4e4e1c85 100644 --- a/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php @@ -226,6 +226,7 @@ class AclBehaviorTest extends CakeTestCase { * @return void */ public function testSetup() { + parent::setUp(); $User = new AclUser(); $this->assertTrue(isset($User->Behaviors->Acl->settings['User'])); $this->assertEquals('requester', $User->Behaviors->Acl->settings['User']['type']); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 2fd7bed05..2803805cd 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -62,6 +62,7 @@ class MysqlTest extends CakeTestCase { * */ public function setUp() { + parent::setUp(); $this->Dbo = ConnectionManager::getDataSource('test'); if (!($this->Dbo instanceof Mysql)) { $this->markTestSkipped('The MySQL extension is not available.'); @@ -76,6 +77,7 @@ class MysqlTest extends CakeTestCase { * */ public function tearDown() { + parent::tearDown(); unset($this->model); ClassRegistry::flush(); Configure::write('debug', $this->_debug); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php index 4cf7d507d..c0cfac57f 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php @@ -215,6 +215,7 @@ class PostgresTest extends CakeTestCase { * */ public function setUp() { + parent::setUp(); Configure::write('Cache.disable', true); $this->Dbo = ConnectionManager::getDataSource('test'); $this->skipIf(!($this->Dbo instanceof Postgres)); @@ -227,6 +228,7 @@ class PostgresTest extends CakeTestCase { * */ public function tearDown() { + parent::tearDown(); Configure::write('Cache.disable', false); unset($this->Dbo2); } diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php index 464bafc1f..be0a98feb 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php @@ -266,6 +266,7 @@ class SqlserverTest extends CakeTestCase { * */ public function setUp() { + parent::setUp(); $this->Dbo = ConnectionManager::getDataSource('test'); if (!($this->Dbo instanceof Sqlserver)) { $this->markTestSkipped('Please configure the test datasource to use SQL Server.'); @@ -280,6 +281,7 @@ class SqlserverTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); unset($this->Dbo); unset($this->model); } diff --git a/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php b/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php index 4edf0c696..efd62ca93 100644 --- a/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php @@ -34,6 +34,7 @@ class DebugTransportTest extends CakeTestCase { * @return void */ public function setUp() { + parent::setUp(); $this->DebugTransport = new DebugTransport(); } diff --git a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php index 9a971d0d8..c255ccd34 100644 --- a/lib/Cake/Test/Case/Network/Email/MailTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/MailTransportTest.php @@ -34,6 +34,7 @@ class MailTransportTest extends CakeTestCase { * @return void */ public function setUp() { + parent::setUp(); $this->MailTransport = $this->getMock('MailTransport', array('_mail')); $this->MailTransport->config(array('additionalParameters' => '-f')); } diff --git a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php index ab4e1dbca..0904bb062 100644 --- a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php @@ -82,6 +82,7 @@ class SmtpTransportTest extends CakeTestCase { * @return void */ public function setUp() { + parent::setUp(); if (!class_exists('MockSocket')) { $this->getMock('CakeSocket', array('read', 'write', 'connect', 'enableCrypto'), array(), 'MockSocket'); } diff --git a/lib/Cake/Test/Case/Network/Http/DigestAuthenticationTest.php b/lib/Cake/Test/Case/Network/Http/DigestAuthenticationTest.php index 69cfb4331..f172e4a7e 100644 --- a/lib/Cake/Test/Case/Network/Http/DigestAuthenticationTest.php +++ b/lib/Cake/Test/Case/Network/Http/DigestAuthenticationTest.php @@ -73,6 +73,7 @@ class DigestAuthenticationTest extends CakeTestCase { * @return void */ public function setUp() { + parent::setUp(); $this->HttpSocket = new DigestHttpSocket(); $this->HttpSocket->request['method'] = 'GET'; $this->HttpSocket->request['uri']['path'] = '/'; @@ -84,6 +85,7 @@ class DigestAuthenticationTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); unset($this->HttpSocket); } diff --git a/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php b/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php index 9f5fbf255..1273bf1ff 100644 --- a/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php +++ b/lib/Cake/Test/Case/Network/Http/HttpResponseTest.php @@ -93,6 +93,7 @@ class HttpResponseTest extends CakeTestCase { * @return void */ public function setUp() { + parent::setUp(); $this->HttpResponse = new TestHttpResponse(); } diff --git a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php index f90ac50a4..afb0f7e02 100644 --- a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php +++ b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php @@ -193,6 +193,7 @@ class HttpSocketTest extends CakeTestCase { * @return void */ public function setUp() { + parent::setUp(); if (!class_exists('MockHttpSocket')) { $this->getMock('TestHttpSocket', array('read', 'write', 'connect'), array(), 'MockHttpSocket'); $this->getMock('TestHttpSocket', array('read', 'write', 'connect', 'request'), array(), 'MockHttpSocketRequests'); @@ -208,6 +209,7 @@ class HttpSocketTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); unset($this->Socket, $this->RequestSocket); } diff --git a/lib/Cake/Test/Case/Routing/DispatcherTest.php b/lib/Cake/Test/Case/Routing/DispatcherTest.php index 8727b78f6..2d10fa241 100644 --- a/lib/Cake/Test/Case/Routing/DispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/DispatcherTest.php @@ -511,6 +511,7 @@ class DispatcherTest extends CakeTestCase { * @return void */ public function setUp() { + parent::setUp(); $this->_get = $_GET; $_GET = array(); $this->_post = $_POST; @@ -538,6 +539,7 @@ class DispatcherTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); $_GET = $this->_get; $_POST = $this->_post; $_FILES = $this->_files; diff --git a/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php b/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php index e8f028301..61f1ee87a 100644 --- a/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php @@ -30,6 +30,7 @@ class AssetDispatcherTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); Configure::write('Dispatcher.filters', array()); } diff --git a/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php b/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php index 906503273..23cca570d 100644 --- a/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php +++ b/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php @@ -189,6 +189,7 @@ class CakeTestFixtureTest extends CakeTestCase { * @return void */ public function setUp() { + parent::setUp(); $methods = array_diff(get_class_methods('DboSource'), array('enabled')); $methods[] = 'connect'; @@ -204,6 +205,7 @@ class CakeTestFixtureTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); unset($this->criticDb); $this->db->config = $this->_backupConfig; } diff --git a/lib/Cake/Test/Case/Utility/CakeTimeTest.php b/lib/Cake/Test/Case/Utility/CakeTimeTest.php index 1ea6d7dac..ed3ac97e1 100644 --- a/lib/Cake/Test/Case/Utility/CakeTimeTest.php +++ b/lib/Cake/Test/Case/Utility/CakeTimeTest.php @@ -52,6 +52,7 @@ class CakeTimeTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); unset($this->Time); $this->_restoreSystemTimezone(); } diff --git a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php index a2da52bde..229b1194f 100644 --- a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php @@ -79,6 +79,7 @@ class PaginatorHelperTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); unset($this->View, $this->Paginator); }