[TASK] Re-work/simplify copyright header in PHP files - Part 4
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Integrity / IntegrityTest.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Integrity;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * This test case is used in test suites to check for healthy
19 * environments after other tests were run.
20 *
21 * This test is usually executed as the very last file in a suite and
22 * should fail if some other test before destroys the environment with
23 * invalid mocking or backups.
24 */
25 class IntegrityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
26
27 /**
28 * This test fails if some test before called
29 * \TYPO3\CMS\Core\Utility\GeneralUtility::purgeInstances() without a proper
30 * backup via \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances()
31 * and a reconstitution via \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances().
32 *
33 * The test for CacheManager should never fail since this object is
34 * already instantiated during bootstrap and must always be there.
35 *
36 * @test
37 */
38 public function standardSingletonIsRegistered() {
39 $registeredSingletons = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
40 $this->assertArrayHasKey('TYPO3\\CMS\\Core\\Cache\\CacheManager', $registeredSingletons);
41 $this->assertTrue($registeredSingletons['TYPO3\\CMS\\Core\\Cache\\CacheManager'] instanceof \TYPO3\CMS\Core\Cache\CacheManager);
42 }
43 }