Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #355 from shama/patch-casing

Consistently setting setUp() and tearDown() on test cases
  • Loading branch information...
commit a32eabe492d67f2b9f8e0e63193bd169ce232d1e 2 parents 3b8990f + 5388237
@markstory markstory authored
Showing with 89 additions and 67 deletions.
  1. +1 −1  lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php
  2. +2 −2 lib/Cake/Test/Case/Configure/IniReaderTest.php
  3. +2 −1  lib/Cake/Test/Case/Console/Command/AclShellTest.php
  4. +1 −1  lib/Cake/Test/Case/Console/Command/BakeShellTest.php
  5. +1 −1  lib/Cake/Test/Case/Console/Command/CommandListShellTest.php
  6. +1 −1  lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
  7. +4 −2 lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php
  8. +1 −1  lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php
  9. +1 −1  lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php
  10. +1 −1  lib/Cake/Test/Case/Console/Command/Task/PluginTaskTest.php
  11. +2 −2 lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php
  12. +3 −3 lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php
  13. +3 −3 lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
  14. +1 −1  lib/Cake/Test/Case/Console/ConsoleErrorHandlerTest.php
  15. +6 −4 lib/Cake/Test/Case/Console/TaskCollectionTest.php
  16. +1 −1  lib/Cake/Test/Case/Controller/Component/Auth/ActionsAuthorizeTest.php
  17. +1 −1  lib/Cake/Test/Case/Controller/Component/Auth/BasicAuthenticateTest.php
  18. +1 −1  lib/Cake/Test/Case/Controller/Component/Auth/DigestAuthenticateTest.php
  19. +6 −4 lib/Cake/Test/Case/Controller/ComponentCollectionTest.php
  20. +4 −2 lib/Cake/Test/Case/Controller/ControllerTest.php
  21. +5 −2 lib/Cake/Test/Case/Error/ErrorHandlerTest.php
  22. +5 −2 lib/Cake/Test/Case/Error/ExceptionRendererTest.php
  23. +2 −2 lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php
  24. +1 −1  lib/Cake/Test/Case/Model/Datasource/Session/CacheSessionTest.php
  25. +6 −4 lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php
  26. +1 −1  lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php
  27. +3 −2 lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php
  28. +2 −2 lib/Cake/Test/Case/Utility/DebuggerTest.php
  29. +3 −3 lib/Cake/Test/Case/Utility/FileTest.php
  30. +1 −1  lib/Cake/Test/Case/Utility/InflectorTest.php
  31. +6 −4 lib/Cake/Test/Case/Utility/ObjectCollectionTest.php
  32. +2 −2 lib/Cake/Test/Case/Utility/ValidationTest.php
  33. +2 −2 lib/Cake/Test/Case/Utility/XmlTest.php
  34. +6 −4 lib/Cake/Test/Case/View/HelperCollectionTest.php
  35. +1 −1  lib/Cake/Test/Case/View/ScaffoldViewTest.php
View
2  lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php
@@ -45,7 +45,7 @@ public function setUp() {
}
/**
- * teardown method
+ * tearDown method
*
* @return void
*/
View
4 lib/Cake/Test/Case/Configure/IniReaderTest.php
@@ -32,8 +32,8 @@ class IniReaderTest extends CakeTestCase {
*
* @return void
*/
- public function setup() {
- parent::setup();
+ public function setUp() {
+ parent::setUp();
$this->path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
}
View
3  lib/Cake/Test/Case/Console/Command/AclShellTest.php
@@ -37,11 +37,12 @@ class AclShellTest extends CakeTestCase {
public $fixtures = array('core.aco', 'core.aro', 'core.aros_aco');
/**
- * setup method
+ * setUp method
*
* @return void
*/
public function setUp() {
+ parent::setUp();
Configure::write('Acl.database', 'test');
Configure::write('Acl.classname', 'DbAcl');
View
2  lib/Cake/Test/Case/Console/Command/BakeShellTest.php
@@ -59,7 +59,7 @@ public function setUp() {
}
/**
- * teardown method
+ * tearDown method
*
* @return void
*/
View
2  lib/Cake/Test/Case/Console/Command/CommandListShellTest.php
@@ -60,7 +60,7 @@ public function setUp() {
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
View
2  lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
@@ -97,7 +97,7 @@ class SchemaShellTest extends CakeTestCase {
);
/**
- * setup method
+ * setUp method
*
* @return void
*/
View
6 lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php
@@ -64,6 +64,7 @@ class ControllerTaskTest extends CakeTestCase {
* @return void
*/
public function setUp() {
+ parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
$this->Task = $this->getMock('ControllerTask',
@@ -86,14 +87,15 @@ public function setUp() {
}
/**
- * teardown method
+ * tearDown method
*
* @return void
*/
- public function teardown() {
+ public function tearDown() {
unset($this->Task);
ClassRegistry::flush();
App::build();
+ parent::tearDown();
}
/**
View
2  lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php
@@ -31,7 +31,7 @@
class DbConfigTaskTest extends CakeTestCase {
/**
- * setup method
+ * setUp method
*
* @return void
*/
View
2  lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php
@@ -95,7 +95,7 @@ protected function _setupOtherMocks() {
}
/**
- * teardown method
+ * tearDown method
*
* @return void
*/
View
2  lib/Cake/Test/Case/Console/Command/Task/PluginTaskTest.php
@@ -36,7 +36,7 @@
class PluginTaskTest extends CakeTestCase {
/**
- * setup method
+ * setUp method
*
* @return void
*/
View
4 lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php
@@ -35,7 +35,7 @@
class ProjectTaskTest extends CakeTestCase {
/**
- * setup method
+ * setUp method
*
* @return void
*/
@@ -52,7 +52,7 @@ public function setUp() {
}
/**
- * teardown method
+ * tearDown method
*
* @return void
*/
View
6 lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php
@@ -33,11 +33,11 @@
class TemplateTaskTest extends CakeTestCase {
/**
- * setup method
+ * setUp method
*
* @return void
*/
- public function setup() {
+ public function setUp() {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
@@ -49,7 +49,7 @@ public function setup() {
}
/**
- * teardown method
+ * tearDown method
*
* @return void
*/
View
6 lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
@@ -220,12 +220,12 @@ class TestTaskTest extends CakeTestCase {
public $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag');
/**
- * setup method
+ * setUp method
*
* @return void
*/
- public function setup() {
- parent::setup();
+ public function setUp() {
+ parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
View
2  lib/Cake/Test/Case/Console/ConsoleErrorHandlerTest.php
@@ -38,7 +38,7 @@ public function setUp() {
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
View
10 lib/Cake/Test/Case/Console/TaskCollectionTest.php
@@ -22,23 +22,25 @@
class TaskCollectionTest extends CakeTestCase {
/**
- * setup
+ * setUp
*
* @return void
*/
- public function setup() {
+ public function setUp() {
+ parent::setUp();
$shell = $this->getMock('Shell', array(), array(), '', false);
$dispatcher = $this->getMock('ShellDispatcher', array(), array(), '', false);
$this->Tasks = new TaskCollection($shell, $dispatcher);
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
- public function teardown() {
+ public function tearDown() {
unset($this->Tasks);
+ parent::tearDown();
}
/**
View
2  lib/Cake/Test/Case/Controller/Component/Auth/ActionsAuthorizeTest.php
@@ -26,7 +26,7 @@
class ActionsAuthorizeTest extends CakeTestCase {
/**
- * setup
+ * setUp
*
* @return void
*/
View
2  lib/Cake/Test/Case/Controller/Component/Auth/BasicAuthenticateTest.php
@@ -57,7 +57,7 @@ public function setUp() {
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
View
2  lib/Cake/Test/Case/Controller/Component/Auth/DigestAuthenticateTest.php
@@ -59,7 +59,7 @@ public function setUp() {
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
View
10 lib/Cake/Test/Case/Controller/ComponentCollectionTest.php
@@ -29,21 +29,23 @@ class CookieAliasComponent extends CookieComponent {
class ComponentCollectionTest extends CakeTestCase {
/**
- * setup
+ * setUp
*
* @return void
*/
- public function setup() {
+ public function setUp() {
+ parent::setUp();
$this->Components = new ComponentCollection();
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
- public function teardown() {
+ public function tearDown() {
unset($this->Components);
+ parent::tearDown();
}
/**
View
6 lib/Cake/Test/Case/Controller/ControllerTest.php
@@ -381,19 +381,21 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
public function setUp() {
+ parent::setUp();
App::objects('plugin', null, false);
App::build();
Router::reload();
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
- public function teardown() {
+ public function tearDown() {
CakePlugin::unload();
App::build();
+ parent::tearDown();
}
/**
View
7 lib/Cake/Test/Case/Error/ErrorHandlerTest.php
@@ -29,12 +29,14 @@
class ErrorHandlerTest extends CakeTestCase {
public $_restoreError = false;
+
/**
* setup create a request object to get out of router later.
*
* @return void
*/
public function setUp() {
+ parent::setUp();
App::build(array(
'View' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
@@ -51,17 +53,18 @@ public function setUp() {
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
- public function teardown() {
+ public function tearDown() {
Configure::write('debug', $this->_debug);
Configure::write('Error', $this->_error);
App::build();
if ($this->_restoreError) {
restore_error_handler();
}
+ parent::tearDown();
}
/**
View
7 lib/Cake/Test/Case/Error/ExceptionRendererTest.php
@@ -142,12 +142,14 @@ class MissingWidgetThingException extends NotFoundException { }
class ExceptionRendererTest extends CakeTestCase {
public $_restoreError = false;
+
/**
* setup create a request object to get out of router later.
*
* @return void
*/
public function setUp() {
+ parent::setUp();
App::build(array(
'views' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
@@ -164,17 +166,18 @@ public function setUp() {
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
- public function teardown() {
+ public function tearDown() {
Configure::write('debug', $this->_debug);
Configure::write('Error', $this->_error);
App::build();
if ($this->_restoreError) {
restore_error_handler();
}
+ parent::tearDown();
}
/**
View
4 lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php
@@ -71,8 +71,8 @@ public static function teardownAfterClass() {
*
* @return void
*/
- public function setup() {
- parent::setup();
+ public function setUp() {
+ parent::setUp();
Configure::write('Session', array(
'defaults' => 'php',
'cookie' => 'cakephp',
View
2  lib/Cake/Test/Case/Model/Datasource/Session/CacheSessionTest.php
@@ -63,7 +63,7 @@ public function setUp() {
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
View
10 lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php
@@ -66,22 +66,24 @@ public static function teardownAfterClass() {
}
/**
- * setup
+ * setUp
*
* @return void
*/
- public function setup() {
+ public function setUp() {
+ parent::setUp();
$this->storage = new DatabaseSession();
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
- public function teardown() {
+ public function tearDown() {
unset($this->storage);
ClassRegistry::flush();
+ parent::tearDown();
}
/**
View
2  lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php
@@ -131,7 +131,7 @@ public function setUp() {
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
View
5 lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php
@@ -22,7 +22,7 @@
class HtmlCoverageReportTest extends CakeTestCase {
/**
- * setup
+ * setUp
*
* @return void
*/
@@ -220,12 +220,13 @@ public function testCoveredLinesTitleAttributes() {
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
public function tearDown() {
CakePlugin::unload();
unset($this->Coverage);
+ parent::tearDown();
}
}
View
4 lib/Cake/Test/Case/Utility/DebuggerTest.php
@@ -44,7 +44,7 @@ class DebuggerTest extends CakeTestCase {
* @return void
*/
public function setUp() {
- parent::setup();
+ parent::setUp();
Configure::write('debug', 2);
Configure::write('log', false);
}
@@ -55,7 +55,7 @@ public function setUp() {
* @return void
*/
public function tearDown() {
- parent::teardown();
+ parent::tearDown();
Configure::write('log', true);
if ($this->_restoreError) {
restore_error_handler();
View
6 lib/Cake/Test/Case/Utility/FileTest.php
@@ -45,12 +45,12 @@ public function setUp() {
}
/**
- * tear down for test.
+ * tearDown method
*
* @return void
*/
- public function teardown() {
- parent::teardown();
+ public function tearDown() {
+ parent::tearDown();
$this->File->close();
unset($this->File);
}
View
2  lib/Cake/Test/Case/Utility/InflectorTest.php
@@ -34,7 +34,7 @@
class InflectorTest extends CakeTestCase {
/**
- * teardown
+ * tearDown
*
* @return void
*/
View
10 lib/Cake/Test/Case/Utility/ObjectCollectionTest.php
@@ -73,21 +73,23 @@ public function load($object, $settings = array()) {
class ObjectCollectionTest extends CakeTestCase {
/**
- * setup
+ * setUp
*
* @return void
*/
- public function setup() {
+ public function setUp() {
+ parent::setUp();
$this->Objects = new GenericObjectCollection();
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
- public function teardown() {
+ public function tearDown() {
unset($this->Objects);
+ parent::tearDown();
}
/**
View
4 lib/Cake/Test/Case/Utility/ValidationTest.php
@@ -90,12 +90,12 @@ static function phone($check) {
class ValidationTest extends CakeTestCase {
/**
- * setup method
+ * setUp method
*
* @return void
*/
public function setUp() {
- parent::setup();
+ parent::setUp();
$this->_appEncoding = Configure::read('App.encoding');
}
View
4 lib/Cake/Test/Case/Utility/XmlTest.php
@@ -91,12 +91,12 @@ class XmlTest extends CakeTestCase {
);
/**
- * setup method
+ * setUp method
*
* @return void
*/
public function setUp() {
- parent::setup();
+ parent::setUp();
$this->_appEncoding = Configure::read('App.encoding');
Configure::write('App.encoding', 'UTF-8');
}
View
10 lib/Cake/Test/Case/View/HelperCollectionTest.php
@@ -29,23 +29,25 @@ class HtmlAliasHelper extends HtmlHelper {
class HelperCollectionTest extends CakeTestCase {
/**
- * setup
+ * setUp
*
* @return void
*/
- public function setup() {
+ public function setUp() {
+ parent::setUp();
$this->View = $this->getMock('View', array(), array(null));
$this->Helpers = new HelperCollection($this->View);
}
/**
- * teardown
+ * tearDown
*
* @return void
*/
- public function teardown() {
+ public function tearDown() {
CakePlugin::unload();
unset($this->Helpers, $this->View);
+ parent::tearDown();
}
/**
View
2  lib/Cake/Test/Case/View/ScaffoldViewTest.php
@@ -96,7 +96,7 @@ public function setUp() {
}
/**
- * teardown method
+ * tearDown method
*
* @return void
*/
Please sign in to comment.
Something went wrong with that request. Please try again.