[BUGFIX] Unit tests for dbbackend throw db errors
authorPhilipp Gampe <forge.typo3.org@philippgampe.info>
Fri, 8 Jul 2011 17:18:10 +0000 (19:18 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 8 Jul 2011 20:17:30 +0000 (22:17 +0200)
When running the unit test for t3lib_cache_backend_dbbackend
eight sql errors are thrown. This could happen if TYPO3_DB is
mocked.

Change-Id: Ie7c55321f2d7825e7af269515ea2b655b581e031
Resolves: #28000
Reviewed-on: http://review.typo3.org/3158
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
tests/t3lib/cache/backend/class.t3lib_cache_backend_dbbackendTest.php

index 86f5aa6..1df8210 100644 (file)
@@ -123,6 +123,8 @@ class t3lib_cache_backend_DbBackendTest extends tx_phpunit_testcase {
         * @author Ingo Renner <ingo@typo3.org>
         */
        public function tearDown() {
+               $GLOBALS['TYPO3_DB'] = $this->typo3DbBackup;
+
                $GLOBALS['TYPO3_DB']->sql_query(
                        'DROP TABLE IF EXISTS ' . $this->testingCacheTable . ';'
                );
@@ -130,8 +132,6 @@ class t3lib_cache_backend_DbBackendTest extends tx_phpunit_testcase {
                $GLOBALS['TYPO3_DB']->sql_query(
                        'DROP TABLE IF EXISTS ' . $this->testingTagsTable . ';'
                );
-
-               $GLOBALS['TYPO3_DB'] = $this->typo3DbBackup;
        }
 
        /**