[FEATURE] Integrate basic file abstraction layer models
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Functional / BaseTestCase.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
6 * (c) 2009-2012 Jochen Rau <jochen.rau@typoplanet.de>
7 * All rights reserved
8 *
9 * This class is a backport of the corresponding class of FLOW3.
10 * All credits go to the v5 team.
11 *
12 * This script is part of the TYPO3 project. The TYPO3 project is
13 * free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * The GNU General Public License can be found at
19 * http://www.gnu.org/copyleft/gpl.html.
20 *
21 * This script is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * This copyright notice MUST APPEAR in all copies of the script!
27 ***************************************************************/
28
29 /**
30 * Base database testcase for the Extbase extension.
31 *
32 * This base test case creates a test database and can populate
33 * rows defined in fixtures to it.
34 *
35 * This class is used in the FAL<->extbase connection tests like
36 * Tx_Extbase_Tests_Functional_Domain_Model_FileContextTest. It is
37 * currently marked as experimental!
38 *
39 * @api experimental! This class is experimental and subject to change!
40 */
41 abstract class Tx_Extbase_Tests_Functional_BaseTestCase extends Tx_Phpunit_Database_TestCase {
42 /**
43 * @var Tx_Extbase_Object_ObjectManagerInterface The object manager
44 */
45 protected $objectManager;
46
47 /**
48 * Injects an untainted clone of the object manager and all its referencing
49 * objects for every test.
50 *
51 * @return void
52 */
53 public function runBare() {
54 $objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
55 $this->objectManager = clone $objectManager;
56 parent::runBare();
57 }
58
59 protected function setUp() {
60 $this->createDatabase();
61 $this->useTestDatabase();
62
63 $this->importStdDb();
64 $this->importExtensions(array('cms', 'extbase'));
65 }
66
67 protected function tearDown() {
68 $this->dropDatabase();
69 }
70 }
71 ?>