[BUGFIX] Wrapper for uniqid() fixes failing tests on Windows 65/35665/9
authorStephan Großberndt <stephan@grossberndt.de>
Mon, 29 Dec 2014 19:17:07 +0000 (20:17 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 19 Jan 2015 15:26:01 +0000 (16:26 +0100)
Create TYPO3\CMS\Core\Tests\BaseTestCase->getUniqueId() as a wrapper to
all uniqid()-calls from tests. This fixes fatal errors on tests in
Windows because multiple calls to uniqid() without parameters within
one second will return the same value.

TYPO3\CMS\Core\Tests\Functional\DataHandling\Framework\ActionService
does not inherit from BaseTestCase and thus gets its own implementation
for now.

Resolves: #64055
Releases: master, 6.2
Change-Id: I15536c0f1766ad89a3d8daf7260b0dbe81ef82f8
Reviewed-on: http://review.typo3.org/35665
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
93 files changed:
typo3/sysext/backend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php
typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php
typo3/sysext/backend/Tests/Unit/Utility/IconUtilityTest.php
typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutCollectionTest.php
typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutTest.php
typo3/sysext/backend/Tests/Unit/View/BackendLayout/DataProviderCollectionTest.php
typo3/sysext/core/Tests/BaseTestCase.php
typo3/sysext/core/Tests/Functional/Category/Collection/CategoryCollectionTest.php
typo3/sysext/core/Tests/Functional/DataHandling/Framework/ActionService.php
typo3/sysext/core/Tests/Functional/Page/PageRendererTest.php
typo3/sysext/core/Tests/Unit/Authentication/BackendUserAuthenticationTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/AbstractBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/ApcBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/MemcachedBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/PdoBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/RedisBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/Typo3DatabaseBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/WincacheBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/XcacheBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/CacheManagerTest.php
typo3/sysext/core/Tests/Unit/Category/CategoryRegistryTest.php
typo3/sysext/core/Tests/Unit/Collection/RecordCollectionRepositoryTest.php
typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php
typo3/sysext/core/Tests/Unit/Core/ClassLoaderTest.php
typo3/sysext/core/Tests/Unit/Core/SystemEnvironmentBuilderTest.php
typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php
typo3/sysext/core/Tests/Unit/FormProtection/BackendFormProtectionTest.php
typo3/sysext/core/Tests/Unit/FormProtection/FormProtectionFactoryTest.php
typo3/sysext/core/Tests/Unit/Log/LogManagerTest.php
typo3/sysext/core/Tests/Unit/Log/Writer/DatabaseWriterTest.php
typo3/sysext/core/Tests/Unit/Log/Writer/FileWriterTest.php
typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php
typo3/sysext/core/Tests/Unit/Page/PageRendererTest.php
typo3/sysext/core/Tests/Unit/Resource/BaseTestCase.php
typo3/sysext/core/Tests/Unit/Resource/Collection/FileCollectionRegistryTest.php
typo3/sysext/core/Tests/Unit/Resource/Driver/DriverRegistryTest.php
typo3/sysext/core/Tests/Unit/Resource/Driver/LocalDriverTest.php
typo3/sysext/core/Tests/Unit/Resource/FileReferenceTest.php
typo3/sysext/core/Tests/Unit/Resource/FileTest.php
typo3/sysext/core/Tests/Unit/Resource/FolderTest.php
typo3/sysext/core/Tests/Unit/Resource/Rendering/RendererRegistryTest.php
typo3/sysext/core/Tests/Unit/Resource/ResourceFactoryTest.php
typo3/sysext/core/Tests/Unit/Resource/ResourceStorageTest.php
typo3/sysext/core/Tests/Unit/Tree/TableConfiguration/TreeDataProviderFactoryTest.php
typo3/sysext/core/Tests/Unit/Type/EnumerationTest.php
typo3/sysext/core/Tests/Unit/TypoScript/TemplateServiceTest.php
typo3/sysext/core/Tests/Unit/Utility/ArrayUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/ExtensionManagementUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/PathUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/RootlineUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/VersionNumberUtilityTest.php
typo3/sysext/extbase/Tests/Unit/DomainObject/AbstractEntityTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/AbstractControllerTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/View/JsonViewTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapperTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/PersistenceManagerTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbQueryParserTest.php
typo3/sysext/extbase/Tests/Unit/Property/PropertyMapperTest.php
typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/DateTimeConverterTest.php
typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/PersistentObjectConverterTest.php
typo3/sysext/extbase/Tests/Unit/Reflection/ClassSchemaTest.php
typo3/sysext/extbase/Tests/Unit/Scheduler/FieldProviderTest.php
typo3/sysext/extbase/Tests/Unit/SignalSlot/DispatcherTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/CollectionValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/GenericObjectValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/StringLengthValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/StringValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/ValidatorResolverTest.php
typo3/sysext/extensionmanager/Tests/Unit/Domain/Repository/ConfigurationItemRepositoryTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/ConfigurationUtilityTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/DependencyUtilityTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/FileHandlingUtilityTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/InstallUtilityTest.php
typo3/sysext/fluid/Tests/Unit/Core/Compiler/AbstractCompilerTemplateTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormFieldViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormViewHelperTest.php
typo3/sysext/form/Tests/Unit/PostProcess/PostProcessorTest.php
typo3/sysext/frontend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/MenuContentObjectFactoryTest.php
typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php
typo3/sysext/frontend/Tests/Unit/Page/PageRepositoryTest.php
typo3/sysext/frontend/Tests/Unit/View/AdminPanelViewTest.php
typo3/sysext/indexed_search/Tests/Unit/IndexerTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/AbstractNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/FileNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/LinkNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/RootNodeTest.php
typo3/sysext/install/Tests/Unit/Service/CoreUpdateServiceTest.php
typo3/sysext/scheduler/Tests/Unit/CronCommand/NormalizeCommandTest.php

index 22f1e18..906a3b0 100644 (file)
@@ -49,7 +49,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function setUp() {
                $this->testTableName = 'conditionMatcherTestTable';
-               $this->testGlobalNamespace = uniqid('TEST');
+               $this->testGlobalNamespace = $this->getUniqueId('TEST');
                $GLOBALS['TCA'][$this->testTableName] = array('ctrl' => array());
                $GLOBALS[$this->testGlobalNamespace] = array();
                $this->setUpBackend();
@@ -102,7 +102,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function simulateEnabledMatchSpecificConditionsSucceeds() {
-               $testCondition = '[' . uniqid('test') . ' = Any condition to simulate a positive match]';
+               $testCondition = '[' . $this->getUniqueId('test') . ' = Any condition to simulate a positive match]';
                $this->matchCondition->setSimulateMatchConditions(array($testCondition));
                $this->assertTrue($this->matchCondition->match($testCondition));
        }
@@ -463,7 +463,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function globalVarConditionMatchesOnEmptyExpressionWithNoValueSet() {
-               $testKey = uniqid('test');
+               $testKey = $this->getUniqueId('test');
                $this->assertTrue($this->matchCondition->match('[globalVar = GP:' . $testKey . '=]'));
                $this->assertTrue($this->matchCondition->match('[globalVar = GP:' . $testKey . ' = ]'));
        }
@@ -474,7 +474,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {
-               $testKey = uniqid('test');
+               $testKey = $this->getUniqueId('test');
                $_GET = array();
                $_POST = array($testKey => 0);
                $this->assertFalse($this->matchCondition->match('[globalVar = GP:' . $testKey . '=]'));
@@ -497,7 +497,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function globalStringConditionMatchesOnEmptyExpressionWithValueSetToEmptyString() {
-               $testKey = uniqid('test');
+               $testKey = $this->getUniqueId('test');
                $_GET = array();
                $_POST = array($testKey => '');
                $this->assertTrue($this->matchCondition->match('[globalString = GP:' . $testKey . '=]'));
@@ -542,7 +542,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function globalStringConditionMatchesEmptyRegularExpression() {
-               $testKey = uniqid('test');
+               $testKey = $this->getUniqueId('test');
                $_SERVER[$testKey] = '';
                $this->assertTrue($this->matchCondition->match('[globalString = _SERVER|' . $testKey . ' = /^$/]'));
        }
@@ -827,7 +827,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function genericGetVariablesSucceedsWithNamespaceENV() {
-               $testKey = uniqid('test');
+               $testKey = $this->getUniqueId('test');
                putenv($testKey . '=testValue');
                $this->assertTrue($this->matchCondition->match('[globalString = ENV:' . $testKey . ' = testValue]'));
        }
index 2e8c41d..860d104 100644 (file)
@@ -158,7 +158,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function getProcessedValueForGroupWithOneAllowedTable() {
                // Disable getRecordWSOL and getRecordTitle dependency by returning stable results
                /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Backend\Utility\BackendUtility $subject */
-               $className = uniqid('BackendUtility');
+               $className = $this->getUniqueId('BackendUtility');
                $subject = __NAMESPACE__ . '\\' . $className;
                eval(
                        'namespace ' . __NAMESPACE__ . ';' .
@@ -213,7 +213,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function getProcessedValueForGroupWithMultipleAllowedTables() {
                // Disable getRecordWSOL and getRecordTitle dependency by returning stable results
                /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Backend\Utility\BackendUtility $subject */
-               $className = uniqid('BackendUtility');
+               $className = $this->getUniqueId('BackendUtility');
                $subject = __NAMESPACE__ . '\\' . $className;
                eval(
                        'namespace ' . __NAMESPACE__ . ';' .
@@ -516,7 +516,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function getLabelFromItemListMergedReturnsCorrectFields($pageId, $table, $column = '', $key = '', array $tca, $expectedLabel = '') {
                // Disable getPagesTSconfig by returning stable result
                /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Backend\Utility\BackendUtility $subject */
-               $className = uniqid('BackendUtility');
+               $className = $this->getUniqueId('BackendUtility');
                $subject = __NAMESPACE__ . '\\' . $className;
                eval(
                        'namespace ' . __NAMESPACE__ . ';' .
@@ -764,7 +764,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getExcludeFieldsReturnsCorrectFieldList($tca, $expected) {
                /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Backend\Utility\BackendUtility $subject */
-               $className = uniqid('BackendUtility');
+               $className = $this->getUniqueId('BackendUtility');
                $subject = __NAMESPACE__ . '\\' . $className;
                eval(
                        'namespace ' . __NAMESPACE__ . ';' .
@@ -891,7 +891,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        ));
 
                /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Backend\Utility\BackendUtility $subject */
-               $className = uniqid('BackendUtility');
+               $className = $this->getUniqueId('BackendUtility');
                $subject = __NAMESPACE__ . '\\' . $className;
                eval(
                        'namespace ' . __NAMESPACE__ . ';' .
@@ -1200,7 +1200,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $GLOBALS['BE_USER']->expects($this->at(1))->method('getTSConfig')->will($this->returnValue(array('value' => NULL, 'properties' => NULL)));
 
                /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Backend\Utility\BackendUtility $subject */
-               $className = uniqid('BackendUtility');
+               $className = $this->getUniqueId('BackendUtility');
                $subject = __NAMESPACE__ . '\\' . $className;
                eval(
                        'namespace ' . __NAMESPACE__ . ';' .
index 3a9af90..899e865 100644 (file)
@@ -57,7 +57,7 @@ class IconUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setUp() {
                // Create a wrapper for IconUtility, so the static property $spriteIconCache is
                // not polluted. Use this as subject!
-               $className = uniqid('IconUtility');
+               $className = $this->getUniqueId('IconUtility');
                eval(
                        'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Backend\\Utility\\IconUtility {' .
@@ -109,7 +109,7 @@ class IconUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $fixtureGifFile = __DIR__ . '/Fixtures/clear.gif';
                // Create image resource, determine target filename, fake target permission, run method and clean up
                $fixtureGifRessource = imagecreatefromgif($fixtureGifFile);
-               $targetFilename = PATH_site . 'typo3temp/' . uniqid('test_') . '.gif';
+               $targetFilename = PATH_site . 'typo3temp/' . $this->getUniqueId('test_') . '.gif';
                $this->testFilesToDelete[] = $targetFilename;
                $GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask'] = '0777';
                $subject = $this->subject;
@@ -546,7 +546,7 @@ class IconUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isOverrideIconOverlayHookCalled() {
-               $classReference = uniqid('user_overrideIconOverlayHook');
+               $classReference = $this->getUniqueId('user_overrideIconOverlayHook');
                $hookMock = $this->getMock($classReference, array('overrideIconOverlay'), array());
                $hookMock->expects($this->once())->method('overrideIconOverlay');
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay'][$classReference] = $classReference;
@@ -561,7 +561,7 @@ class IconUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isFaultyOverrideIconOverlayHookNotCalled() {
-               $classReference = uniqid('user_overrideIconOverlayHook');
+               $classReference = $this->getUniqueId('user_overrideIconOverlayHook');
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay'][$classReference] = $classReference;
                $GLOBALS['T3_VAR']['getUserObj'][$classReference] = new \stdClass();
                $subject = $this->subject;
@@ -753,7 +753,7 @@ class IconUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                'iconsAvailable' => array()
                        ),
                );
-               $classReference = uniqid('user_overrideResourceIconHook');
+               $classReference = $this->getUniqueId('user_overrideResourceIconHook');
                $folderObject = $this->getTestSubjectFolderObject('/test');
                $hookMock = $this->getMock(\TYPO3\CMS\Backend\Utility\IconUtilityOverrideResourceIconHookInterface::class, array('overrideResourceIcon'), array(), $classReference);
                $hookMock->expects($this->once())->method('overrideResourceIcon');
@@ -770,7 +770,7 @@ class IconUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \UnexpectedValueException
         */
        public function isFaultyResourceIconHookNotCalled() {
-               $classReference = uniqid('user_overrideResourceIconHook');
+               $classReference = $this->getUniqueId('user_overrideResourceIconHook');
                $folderObject = $this->getTestSubjectFolderObject('/test');
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideResourceIcon'][$classReference] = $classReference;
                $GLOBALS['T3_VAR']['getUserObj'][$classReference] = new \stdClass();
index 3a00d77..d84358a 100644 (file)
@@ -26,7 +26,7 @@ class BackendLayoutCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \UnexpectedValueException
         */
        public function invalidIdentifierIsRecognizedOnCreation() {
-               $identifier = uniqid('identifier__');
+               $identifier = $this->getUniqueId('identifier__');
                new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier);
        }
 
@@ -34,7 +34,7 @@ class BackendLayoutCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function objectIsCreated() {
-               $identifier = uniqid('identifier');
+               $identifier = $this->getUniqueId('identifier');
                $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier);
 
                $this->assertEquals($identifier, $backendLayoutCollection->getIdentifier());
@@ -45,9 +45,9 @@ class BackendLayoutCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \UnexpectedValueException
         */
        public function invalidBackendLayoutIsRecognizedOnAdding() {
-               $identifier = uniqid('identifier');
+               $identifier = $this->getUniqueId('identifier');
                $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier);
-               $backendLayoutIdentifier = uniqid('identifier__');
+               $backendLayoutIdentifier = $this->getUniqueId('identifier__');
                $backendLayoutMock = $this->getMock(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class, array('getIdentifier'), array(), '', FALSE);
                $backendLayoutMock->expects($this->once())->method('getIdentifier')->will($this->returnValue($backendLayoutIdentifier));
 
@@ -59,9 +59,9 @@ class BackendLayoutCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \LogicException
         */
        public function duplicateBackendLayoutIsRecognizedOnAdding() {
-               $identifier = uniqid('identifier');
+               $identifier = $this->getUniqueId('identifier');
                $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier);
-               $backendLayoutIdentifier = uniqid('identifier');
+               $backendLayoutIdentifier = $this->getUniqueId('identifier');
                $firstBackendLayoutMock = $this->getMock(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class, array('getIdentifier'), array(), '', FALSE);
                $firstBackendLayoutMock->expects($this->once())->method('getIdentifier')->will($this->returnValue($backendLayoutIdentifier));
                $secondBackendLayoutMock = $this->getMock(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class, array('getIdentifier'), array(), '', FALSE);
@@ -75,9 +75,9 @@ class BackendLayoutCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function backendLayoutCanBeFetched() {
-               $identifier = uniqid('identifier');
+               $identifier = $this->getUniqueId('identifier');
                $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier);
-               $backendLayoutIdentifier = uniqid('identifier');
+               $backendLayoutIdentifier = $this->getUniqueId('identifier');
                $backendLayoutMock = $this->getMock(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class, array('getIdentifier'), array(), '', FALSE);
                $backendLayoutMock->expects($this->once())->method('getIdentifier')->will($this->returnValue($backendLayoutIdentifier));
 
index 26e3bb0..ea18450 100644 (file)
@@ -26,9 +26,9 @@ class BackendLayoutTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \UnexpectedValueException
         */
        public function invalidIdentifierIsRecognizedOnCreation() {
-               $identifier = uniqid('identifier__');
-               $title = uniqid('title');
-               $configuration = uniqid('configuration');
+               $identifier = $this->getUniqueId('identifier__');
+               $title = $this->getUniqueId('title');
+               $configuration = $this->getUniqueId('configuration');
                new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayout($identifier, $title, $configuration);
        }
 
@@ -36,9 +36,9 @@ class BackendLayoutTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function objectIsCreated() {
-               $identifier = uniqid('identifier');
-               $title = uniqid('title');
-               $configuration = uniqid('configuration');
+               $identifier = $this->getUniqueId('identifier');
+               $title = $this->getUniqueId('title');
+               $configuration = $this->getUniqueId('configuration');
                $backendLayout = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayout($identifier, $title, $configuration);
 
                $this->assertEquals($identifier, $backendLayout->getIdentifier());
index 014e34d..ce8f2cd 100644 (file)
@@ -38,7 +38,7 @@ class DataProviderCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \UnexpectedValueException
         */
        public function invalidIdentifierIsRecognizedOnAdding() {
-               $identifier = uniqid('identifier__');
+               $identifier = $this->getUniqueId('identifier__');
                $dataProviderMock = $this->getMock('stdClass');
 
                $this->dataProviderCollection->add($identifier, get_class($dataProviderMock));
@@ -49,7 +49,7 @@ class DataProviderCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \LogicException
         */
        public function invalidInterfaceIsRecognizedOnAdding() {
-               $identifier = uniqid('identifier');
+               $identifier = $this->getUniqueId('identifier');
                $dataProviderMock = $this->getMock('stdClass');
 
                $this->dataProviderCollection->add($identifier, get_class($dataProviderMock));
@@ -59,7 +59,7 @@ class DataProviderCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function defaultBackendLayoutIsFound() {
-               $backendLayoutIdentifier = uniqid('identifier');
+               $backendLayoutIdentifier = $this->getUniqueId('identifier');
 
                $dataProviderMock = $this->getMock(\TYPO3\CMS\Backend\View\BackendLayout\DefaultDataProvider::class, array('getBackendLayout'), array(), '', FALSE);
                $backendLayoutMock = $this->getMock(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class, array('getIdentifier'), array(), '', FALSE);
@@ -77,8 +77,8 @@ class DataProviderCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function providedBackendLayoutIsFound() {
-               $dataProviderIdentifier = uniqid('custom');
-               $backendLayoutIdentifier = uniqid('identifier');
+               $dataProviderIdentifier = $this->getUniqueId('custom');
+               $backendLayoutIdentifier = $this->getUniqueId('identifier');
 
                $dataProviderMock = $this->getMock(\TYPO3\CMS\Backend\View\BackendLayout\DefaultDataProvider::class, array('getBackendLayout'), array(), '', FALSE);
                $backendLayoutMock = $this->getMock(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class, array('getIdentifier'), array(), '', FALSE);
index 9d49ec1..0516131 100644 (file)
@@ -114,7 +114,7 @@ abstract class BaseTestCase extends \PHPUnit_Framework_TestCase {
         * @return string Fully qualified name of the built class, will not be empty
         */
        protected function buildAccessibleProxy($className) {
-               $accessibleClassName = str_replace('.', '', uniqid('Tx_Phpunit_AccessibleProxy', TRUE));
+               $accessibleClassName = str_replace('.', '', $this->getUniqueId('Tx_Phpunit_AccessibleProxy'));
                $class = new \ReflectionClass($className);
                $abstractModifier = $class->isAbstract() ? 'abstract ' : '';
 
@@ -267,4 +267,17 @@ abstract class BaseTestCase extends \PHPUnit_Framework_TestCase {
                }
        }
 
+       /**
+        * Create and return a unique id optionally prepended by a given string
+        *
+        * This function is used because on windows and in cygwin environments uniqid() has a resolution of one second which
+        * results in identical ids if simply uniqid('Foo'); is called.
+        *
+        * @param string $prefix
+        * @return string
+        */
+       protected function getUniqueId($prefix = '') {
+               return $prefix . str_replace('.', '', uniqid(mt_rand(), TRUE));
+       }
+
 }
index 1ec6789..90ef46b 100644 (file)
@@ -69,8 +69,8 @@ class CategoryCollectionTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
                $this->fixture = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Category\Collection\CategoryCollection::class, $this->tableName);
                $this->collectionRecord = array(
                        'uid' => 0,
-                       'title' => uniqid('title'),
-                       'description' => uniqid('description'),
+                       'title' => $this->getUniqueId('title'),
+                       'description' => $this->getUniqueId('description'),
                        'table_name' => $this->tableName,
                );
                $GLOBALS['TCA'][$this->tableName] = array('ctrl' => array());
@@ -163,7 +163,7 @@ class CategoryCollectionTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
                $fakeRecord = array(
                        'uid' => $this->numberOfRecords + 1,
                        'pid' => 0,
-                       'title' => uniqid('title'),
+                       'title' => $this->getUniqueId('title'),
                        'categories' => 0
                );
                // Check the number of records
@@ -181,7 +181,7 @@ class CategoryCollectionTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
                $fakeRecord = array(
                        'uid' => $this->numberOfRecords + 1,
                        'pid' => 0,
-                       'title' => uniqid('title'),
+                       'title' => $this->getUniqueId('title'),
                        'categories' => 0
                );
                // Check the number of records
@@ -211,7 +211,7 @@ class CategoryCollectionTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
        private function populateDummyTable() {
                for ($index = 1; $index <= $this->numberOfRecords; $index++) {
                        $values = array(
-                               'title' => uniqid('title')
+                               'title' => $this->getUniqueId('title')
                        );
                        $this->database->exec_INSERTquery($this->tableName, $values);
                }
@@ -272,7 +272,7 @@ class CategoryCollectionTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
                        $this->database->sql_query($_sql);
                }
                $values = array(
-                       'title' => uniqid('title'),
+                       'title' => $this->getUniqueId('title'),
                        'is_dummy_record' => 1
                );
                $this->database->exec_INSERTquery('sys_category', $values);
index 95426f7..50a9be4 100644 (file)
@@ -59,7 +59,8 @@ class ActionService {
                        if (!isset($recordData['pid'])) {
                                $recordData['pid'] = $pageId;
                        }
-                       $currentUid = uniqid('NEW', TRUE);
+                       // @see \TYPO3\CMS\Core\Tests\BaseTestCase->uniqid()
+                       $currentUid = 'NEW' . str_replace('.', '', uniqid(mt_rand(), TRUE));
                        $newTableIds[$tableName][] = $currentUid;
                        $dataMap[$tableName][$currentUid] = $recordData;
                        if ($previousTableName !== NULL && $previousUid !== NULL) {
@@ -131,7 +132,8 @@ class ActionService {
                        $currentUid = $recordData['uid'];
                        if ($recordData['uid'] === '__NEW') {
                                $recordData['pid'] = $pageId;
-                               $currentUid = uniqid('NEW', TRUE);
+                               // @see \TYPO3\CMS\Core\Tests\BaseTestCase->uniqid()
+                               $currentUid = 'NEW' . str_replace('.', '', uniqid(mt_rand(), TRUE));
                        }
                        unset($recordData['uid']);
                        $dataMap[$tableName][$currentUid] = $recordData;
index 0aae849..dfef737 100644 (file)
@@ -30,7 +30,7 @@ class PageRendererTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
                $prologueString = $expectedPrologueString = '<?xml version="1.0" encoding="utf-8" ?>';
                $subject->setXmlPrologAndDocType($prologueString);
 
-               $title = uniqid('aTitle-');
+               $title = $this->getUniqueId('aTitle-');
                $subject->setTitle($title);
                $expectedTitleString = '<title>' . $title . '</title>';
 
@@ -50,7 +50,7 @@ class PageRendererTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
                $metaTag = $expectedMetaTagString = '<meta name="author" content="Anna Lyse">';
                $subject->addMetaTag($metaTag);
 
-               $inlineComment = uniqid('comment');
+               $inlineComment = $this->getUniqueId('comment');
                $subject->addInlineComment($inlineComment);
                $expectedInlineCommentString = '<!-- ' . LF . $inlineComment . '-->';
 
@@ -63,15 +63,15 @@ class PageRendererTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
                $subject->addJsFile('fileadmin/test.js', 'text/javascript', FALSE, FALSE, 'wrapBeforeXwrapAfter', FALSE, 'X');
                $expectedJsFileRegExp = '#wrapBefore<script src="fileadmin/test\\.(js|\\d+\\.js|js\\?\\d+)" type="text/javascript"></script>wrapAfter#';
 
-               $jsInlineCode = $expectedJsInlineCodeString = 'var x = "' . uniqid('jsInline-') . '"';
-               $subject->addJsInlineCode(uniqid(), $jsInlineCode);
+               $jsInlineCode = $expectedJsInlineCodeString = 'var x = "' . $this->getUniqueId('jsInline-') . '"';
+               $subject->addJsInlineCode($this->getUniqueId(), $jsInlineCode);
 
-               $extOnReadyCode = $expectedExtOnReadyCodePartOne = uniqid('extOnReady-');
+               $extOnReadyCode = $expectedExtOnReadyCodePartOne = $this->getUniqueId('extOnReady-');
                $expectedExtOnReadyCodePartTwo = 'Ext.onReady(function() {';
                $subject->loadExtJS();
                $subject->addExtOnReadyCode($extOnReadyCode);
 
-               $cssFile = uniqid('cssFile-');
+               $cssFile = $this->getUniqueId('cssFile-');
                $expectedCssFileString = 'wrapBefore<link rel="stylesheet" type="text/css" href="' . $cssFile . '" media="print" />wrapAfter';
                $subject->addCssFile($cssFile, 'stylesheet', 'print', '', TRUE, FALSE, 'wrapBeforeXwrapAfter', FALSE, 'X');
 
@@ -95,7 +95,7 @@ class PageRendererTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
                $subject->loadExtJS(TRUE, TRUE, 'jquery');
                $expectedExtJsRegExp = '#<script src="contrib/extjs/adapter/jquery/ext-jquery-adapter\\.(js|\\d+\\.js|js\\?\\d+)" type="text/javascript"></script>' . LF . '<script src="contrib/extjs/ext-all\\.(js|\\d+\\.js|js\\?\\d+)" type="text/javascript"></script>#m';
 
-               $expectedBodyContent = uniqid('ABCDE-');
+               $expectedBodyContent = $this->getUniqueId('ABCDE-');
                $subject->setBodyContent($expectedBodyContent);
 
                $renderedString = $subject->render();
@@ -146,8 +146,8 @@ class PageRendererTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
                $expectedJsFooterRegExp = '#wrapBefore<script src="fileadmin/test\\.(js|\\d+\\.js|js\\?\\d+)" type="text/javascript"></script>wrapAfter#';
                $subject->addJsFooterFile('fileadmin/test.js', 'text/javascript', FALSE, FALSE, 'wrapBeforeXwrapAfter', FALSE, 'X');
 
-               $jsFooterInlineCode = $expectedJsFooterInlineCodeString = 'var x = "' . uniqid('jsFooterInline-') . '"';
-               $subject->addJsFooterInlineCode(uniqid(), $jsFooterInlineCode);
+               $jsFooterInlineCode = $expectedJsFooterInlineCodeString = 'var x = "' . $this->getUniqueId('jsFooterInline-') . '"';
+               $subject->addJsFooterInlineCode($this->getUniqueId(), $jsFooterInlineCode);
 
                // Bunch of label tests
                $subject->loadExtJS();
index 1a4ef32..204b82c 100644 (file)
@@ -77,7 +77,7 @@ class BackendUserAuthenticationTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
                // logoff() call the static factory that has a dependency to a valid BE_USER object. Mock this away
                $GLOBALS['BE_USER'] = $this->getMock(\TYPO3\CMS\Core\Authentication\BackendUserAuthentication::class, array(), array(), '', FALSE);
-               $GLOBALS['BE_USER']->user = array('uid' => uniqid());
+               $GLOBALS['BE_USER']->user = array('uid' => $this->getUniqueId());
                $GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class, array(), array(), '', FALSE);
 
                $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Authentication\BackendUserAuthentication::class, array('dummy'), array(), '', FALSE);
index 7c203e2..9231a47 100644 (file)
@@ -32,7 +32,7 @@ class AbstractBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @return void
         */
        public function setUp() {
-               $className = 'ConcreteBackend_' . md5(uniqid(mt_rand(), TRUE));
+               $className = $this->getUniqueId('ConcreteBackend_');
                eval('
                        class ' . $className . ' extends TYPO3\\CMS\\Core\\Cache\\Backend\\AbstractBackend {
                                public function set($entryIdentifier, $data, array $tags = array(), $lifetime = NULL) {}
index 1133980..7f7c70c 100644 (file)
@@ -50,7 +50,7 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setThrowsExceptionIfNoFrontEndHasBeenSet() {
                $backend = new ApcBackend('Testing');
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
        }
 
@@ -60,7 +60,7 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToSetAndCheckExistenceInCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $inCache = $backend->has($identifier);
                $this->assertTrue($inCache, 'APC backend failed to set and check entry');
@@ -72,7 +72,7 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToSetAndGetEntry() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $fetchedData = $backend->get($identifier);
                $this->assertEquals($data, $fetchedData, 'APC backend failed to set and retrieve data');
@@ -84,7 +84,7 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToRemoveEntryFromCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $backend->remove($identifier);
                $inCache = $backend->has($identifier);
@@ -97,7 +97,7 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToOverwriteAnEntryInTheCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $otherData = 'some other data';
                $backend->set($identifier, $otherData);
@@ -111,7 +111,7 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function findIdentifiersByTagFindsSetEntries() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data, array('UnitTestTag%tag1', 'UnitTestTag%tag2'));
                $retrieved = $backend->findIdentifiersByTag('UnitTestTag%tag1');
                $this->assertEquals($identifier, $retrieved[0], 'Could not retrieve expected entry by tag.');
@@ -125,7 +125,7 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setRemovesTagsFromPreviousSet() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data, array('UnitTestTag%tag1', 'UnitTestTag%tagX'));
                $backend->set($identifier, $data, array('UnitTestTag%tag3'));
                $retrieved = $backend->findIdentifiersByTag('UnitTestTag%tagX');
@@ -167,7 +167,7 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function hasReturnsFalseIfTheEntryDoesNotExist() {
                $backend = $this->setUpBackend();
-               $identifier = 'NonExistingIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('NonExistingIdentifier');
                $inCache = $backend->has($identifier);
                $this->assertFalse($inCache, '"has" did not return FALSE when checking on non existing identifier');
        }
@@ -177,7 +177,7 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function removeReturnsFalseIfTheEntryDoesntExist() {
                $backend = $this->setUpBackend();
-               $identifier = 'NonExistingIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('NonExistingIdentifier');
                $inCache = $backend->remove($identifier);
                $this->assertFalse($inCache, '"remove" did not return FALSE when checking on non existing identifier');
        }
@@ -242,7 +242,7 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function largeDataIsStored() {
                $backend = $this->setUpBackend();
                $data = str_repeat('abcde', 1024 * 1024);
-               $identifier = 'tooLargeData' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('tooLargeData');
                $backend->set($identifier, $data);
                $this->assertTrue($backend->has($identifier));
                $this->assertEquals($backend->get($identifier), $data);
@@ -252,7 +252,7 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function setTagsOnlyOnceToIdentifier() {
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $tags = array('UnitTestTag%test', 'UnitTestTag%boring');
 
                $backend = $this->setUpBackend(TRUE);
index acf40b7..a990a89 100644 (file)
@@ -52,7 +52,7 @@ class MemcachedBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $backend = new MemcachedBackend('Testing', $backendOptions);
                $backend->initializeObject();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
        }
 
@@ -71,7 +71,7 @@ class MemcachedBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToSetAndCheckExistenceInCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $inCache = $backend->has($identifier);
                $this->assertTrue($inCache, 'Memcache failed to set and check entry');
@@ -83,7 +83,7 @@ class MemcachedBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToSetAndGetEntry() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $fetchedData = $backend->get($identifier);
                $this->assertEquals($data, $fetchedData, 'Memcache failed to set and retrieve data');
@@ -95,7 +95,7 @@ class MemcachedBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToRemoveEntryFromCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $backend->remove($identifier);
                $inCache = $backend->has($identifier);
@@ -108,7 +108,7 @@ class MemcachedBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToOverwriteAnEntryInTheCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $otherData = 'some other data';
                $backend->set($identifier, $otherData);
@@ -122,7 +122,7 @@ class MemcachedBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function findIdentifiersByTagFindsCacheEntriesWithSpecifiedTag() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data, array('UnitTestTag%tag1', 'UnitTestTag%tag2'));
                $retrieved = $backend->findIdentifiersByTag('UnitTestTag%tag1');
                $this->assertEquals($identifier, $retrieved[0], 'Could not retrieve expected entry by tag.');
@@ -136,7 +136,7 @@ class MemcachedBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setRemovesTagsFromPreviousSet() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data, array('UnitTestTag%tag1', 'UnitTestTag%tag2'));
                $backend->set($identifier, $data, array('UnitTestTag%tag3'));
                $retrieved = $backend->findIdentifiersByTag('UnitTestTag%tagX');
@@ -148,7 +148,7 @@ class MemcachedBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function hasReturnsFalseIfTheEntryDoesntExist() {
                $backend = $this->setUpBackend();
-               $identifier = 'NonExistingIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('NonExistingIdentifier');
                $inCache = $backend->has($identifier);
                $this->assertFalse($inCache, '"has" did not return FALSE when checking on non existing identifier');
        }
@@ -158,7 +158,7 @@ class MemcachedBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function removeReturnsFalseIfTheEntryDoesntExist() {
                $backend = $this->setUpBackend();
-               $identifier = 'NonExistingIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('NonExistingIdentifier');
                $inCache = $backend->remove($identifier);
                $this->assertFalse($inCache, '"remove" did not return FALSE when checking on non existing identifier');
        }
@@ -237,7 +237,7 @@ class MemcachedBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function setTagsOnlyOnceToIdentifier() {
                $backendOptions = array('servers' => array('localhost:11211'));
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $tags = array('UnitTestTag%test', 'UnitTestTag%boring');
 
                $backend = $this->setUpBackend($backendOptions, TRUE);
index 684f464..01926e5 100644 (file)
@@ -123,7 +123,7 @@ class PdoBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setOverwritesExistingEntryThatExceededItsLifetimeWithNewData() {
                $backend = $this->setUpBackend();
                $data1 = 'data1';
-               $entryIdentifier = uniqid('test');
+               $entryIdentifier = $this->getUniqueId('test');
                $backend->set($entryIdentifier, $data1, array(), 1);
                $data2 = 'data2';
                $GLOBALS['EXEC_TIME'] += 2;
index ac538fb..0da634e 100644 (file)
@@ -158,7 +158,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function setThrowsExceptionIfDataIsNotAString() {
                $this->setUpBackend();
-               $this->backend->set('identifier' . uniqid(), array());
+               $this->backend->set($this->getUniqueId('identifier'), array());
        }
 
        /**
@@ -167,7 +167,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function setThrowsExceptionIfLifetimeIsNegative() {
                $this->setUpBackend();
-               $this->backend->set('identifier' . uniqid(), 'data', array(), -42);
+               $this->backend->set($this->getUniqueId('identifier'), 'data', array(), -42);
        }
 
        /**
@@ -176,7 +176,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function setThrowsExceptionIfLifetimeIsNotNullOrAnInteger() {
                $this->setUpBackend();
-               $this->backend->set('identifier' . uniqid(), 'data', array(), array());
+               $this->backend->set($this->getUniqueId('identifier'), 'data', array(), array());
        }
 
        /**
@@ -186,7 +186,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->setUpRedis();
                $this->redis->select(1);
                $this->setUpBackend(array('database' => 1));
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, 'data');
                $this->assertTrue($this->redis->exists('identData:' . $identifier));
        }
@@ -197,7 +197,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setSavesStringDataTypeForIdentifierToDataEntry() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, 'data');
                $this->assertSame(\Redis::REDIS_STRING, $this->redis->type('identData:' . $identifier));
        }
@@ -208,7 +208,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setSavesEntryWithDefaultLifeTime() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $defaultLifetime = 42;
                $this->backend->setDefaultLifetime($defaultLifetime);
                $this->backend->set($identifier, 'data');
@@ -222,7 +222,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setSavesEntryWithSpecifiedLifeTime() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $lifetime = 43;
                $this->backend->set($identifier, 'data', array(), $lifetime);
                $lifetimeRegisteredInBackend = $this->redis->ttl('identData:' . $identifier);
@@ -235,7 +235,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setSavesEntryWithUnlimitedLifeTime() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, 'data', array(), 0);
                $lifetimeRegisteredInBackend = $this->redis->ttl('identData:' . $identifier);
                $this->assertSame(31536000, $lifetimeRegisteredInBackend);
@@ -247,7 +247,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setOverwritesExistingEntryWithNewData() {
                $this->setUpBackend();
                $data = 'data 1';
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, $data);
                $otherData = 'data 2';
                $this->backend->set($identifier, $otherData);
@@ -262,7 +262,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->setUpBackend();
                $this->setUpRedis();
                $data = 'data';
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, $data);
                $lifetime = 42;
                $this->backend->set($identifier, $data, array(), $lifetime);
@@ -277,7 +277,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->setUpBackend();
                $this->setUpRedis();
                $data = 'data';
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $lifetime = 42;
                $this->backend->set($identifier, $data, array(), $lifetime);
                $newDefaultLifetime = 43;
@@ -294,7 +294,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->setUpBackend();
                $this->setUpRedis();
                $data = 'data';
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $lifetime = 42;
                $this->backend->set($identifier, $data, array(), $lifetime);
                $this->backend->set($identifier, $data, array(), 0);
@@ -308,7 +308,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setSavesSetDataTypeForIdentifierToTagsSet() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, 'data', array('tag'));
                $this->assertSame(\Redis::REDIS_SET, $this->redis->type('identTags:' . $identifier));
        }
@@ -319,7 +319,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setSavesSpecifiedTagsInIdentifierToTagsSet() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $tags = array('thatTag', 'thisTag');
                $this->backend->set($identifier, 'data', $tags);
                $savedTags = $this->redis->sMembers('identTags:' . $identifier);
@@ -333,7 +333,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setRemovesAllPreviouslySetTagsFromIdentifierToTagsSet() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $tags = array('fooTag', 'barTag');
                $this->backend->set($identifier, 'data', $tags);
                $this->backend->set($identifier, 'data', array());
@@ -346,7 +346,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setRemovesMultiplePreviouslySetTagsFromIdentifierToTagsSet() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $firstTagSet = array('tag1', 'tag2', 'tag3', 'tag4');
                $this->backend->set($identifier, 'data', $firstTagSet);
                $secondTagSet = array('tag1', 'tag3');
@@ -362,7 +362,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setSavesSetDataTypeForTagToIdentifiersSet() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $tag = 'tag';
                $this->backend->set($identifier, 'data', array($tag));
                $this->assertSame(\Redis::REDIS_SET, $this->redis->type('tagIdents:' . $tag));
@@ -374,7 +374,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setSavesIdentifierInTagToIdentifiersSetOfSpecifiedTag() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $tag = 'thisTag';
                $this->backend->set($identifier, 'data', array($tag));
                $savedTagToIdentifiersMemberArray = $this->redis->sMembers('tagIdents:' . $tag);
@@ -387,10 +387,10 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setAppendsSecondIdentifierInTagToIdentifiersEntry() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $firstIdentifier = 'identifier' . uniqid();
+               $firstIdentifier = $this->getUniqueId('identifier');
                $tag = 'thisTag';
                $this->backend->set($firstIdentifier, 'data', array($tag));
-               $secondIdentifier = 'identifier' . uniqid();
+               $secondIdentifier = $this->getUniqueId('identifier');
                $this->backend->set($secondIdentifier, 'data', array($tag));
                $savedTagToIdentifiersMemberArray = $this->redis->sMembers('tagIdents:' . $tag);
                sort($savedTagToIdentifiersMemberArray);
@@ -405,7 +405,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setRemovesIdentifierFromTagToIdentifiersEntryIfTagIsOmittedOnConsecutiveSet() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $tag = 'thisTag';
                $this->backend->set($identifier, 'data', array($tag));
                $this->backend->set($identifier, 'data', array());
@@ -419,7 +419,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setAddsIdentifierInTagToIdentifiersEntryIfTagIsAddedOnConsecutiveSet() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, 'data');
                $tag = 'thisTag';
                $this->backend->set($identifier, 'data', array($tag));
@@ -435,7 +435,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        'compression' => TRUE
                ));
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $data = 'some data ' . microtime();
                $this->backend->set($identifier, $data);
                $uncompresedStoredData = '';
@@ -456,7 +456,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        'compressionLevel' => 0
                ));
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $data = 'some data ' . microtime();
                $this->backend->set($identifier, $data);
                $this->assertGreaterThan(0, substr_count($this->redis->get('identData:' . $identifier), $data), 'Plaintext data not found');
@@ -476,7 +476,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function hasReturnsFalseForNotExistingEntry() {
                $this->setUpBackend();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->assertFalse($this->backend->has($identifier));
        }
 
@@ -485,7 +485,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function hasReturnsTrueForPreviouslySetEntry() {
                $this->setUpBackend();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, 'data');
                $this->assertTrue($this->backend->has($identifier));
        }
@@ -507,7 +507,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        'compression' => TRUE
                ));
                $data = 'data';
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, $data);
                $fetchedData = $this->backend->get($identifier);
                $this->assertSame($data, $fetchedData);
@@ -519,7 +519,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function getReturnsPreviouslySetEntry() {
                $this->setUpBackend();
                $data = 'data';
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, $data);
                $fetchedData = $this->backend->get($identifier);
                $this->assertSame($data, $fetchedData);
@@ -539,7 +539,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function removeReturnsFalseIfNoEntryWasDeleted() {
                $this->setUpBackend();
-               $this->assertFalse($this->backend->remove('identifier' . uniqid()));
+               $this->assertFalse($this->backend->remove($this->getUniqueId('identifier')));
        }
 
        /**
@@ -547,7 +547,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function removeReturnsTrueIfAnEntryWasDeleted() {
                $this->setUpBackend();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, 'data');
                $this->assertTrue($this->backend->remove($identifier));
        }
@@ -557,7 +557,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function removeDeletesEntryFromCache() {
                $this->setUpBackend();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, 'data');
                $this->backend->remove($identifier);
                $this->assertFalse($this->backend->has($identifier));
@@ -569,7 +569,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function removeDeletesIdentifierToTagEntry() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $tag = 'thisTag';
                $this->backend->set($identifier, 'data', array($tag));
                $this->backend->remove($identifier);
@@ -582,7 +582,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function removeDeletesIdentifierFromTagToIdentifiersSet() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $tag = 'thisTag';
                $this->backend->set($identifier, 'data', array($tag));
                $this->backend->remove($identifier);
@@ -596,8 +596,8 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function removeDeletesIdentifierFromTagToIdentifiersSetWithMultipleEntries() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $firstIdentifier = 'identifier' . uniqid();
-               $secondIdentifier = 'identifier' . uniqid();
+               $firstIdentifier = $this->getUniqueId('identifier');
+               $secondIdentifier = $this->getUniqueId('identifier');
                $tag = 'thisTag';
                $this->backend->set($firstIdentifier, 'data', array($tag));
                $this->backend->set($secondIdentifier, 'data', array($tag));
@@ -628,9 +628,9 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function findIdentifiersByTagReturnsAllIdentifiersTagedWithSpecifiedTag() {
                $this->setUpBackend();
-               $firstIdentifier = 'identifier' . uniqid();
-               $secondIdentifier = 'identifier' . uniqid();
-               $thirdIdentifier = 'identifier' . uniqid();
+               $firstIdentifier = $this->getUniqueId('identifier');
+               $secondIdentifier = $this->getUniqueId('identifier');
+               $thirdIdentifier = $this->getUniqueId('identifier');
                $tagsForFirstIdentifier = array('thisTag');
                $tagsForSecondIdentifier = array('thatTag');
                $tagsForThirdIdentifier = array('thisTag', 'thatTag');
@@ -649,7 +649,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function flushRemovesAllEntriesFromCache() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier, 'data');
                $this->backend->flush();
                $this->assertSame(array(), $this->redis->getKeys('*'));
@@ -669,7 +669,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function flushByTagRemovesEntriesTaggedWithSpecifiedTag() {
                $this->setUpBackend();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier . 'A', 'data', array('tag1'));
                $this->backend->set($identifier . 'B', 'data', array('tag2'));
                $this->backend->set($identifier . 'C', 'data', array('tag1', 'tag2'));
@@ -689,7 +689,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function flushByTagRemovesTemporarySet() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier . 'A', 'data', array('tag1'));
                $this->backend->set($identifier . 'C', 'data', array('tag1', 'tag2'));
                $this->backend->flushByTag('tag1');
@@ -702,7 +702,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function flushByTagRemovesIdentifierToTagsSetOfEntryTaggedWithGivenTag() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $tag = 'tag1';
                $this->backend->set($identifier, 'data', array($tag));
                $this->backend->flushByTag($tag);
@@ -715,10 +715,10 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function flushByTagDoesNotRemoveIdentifierToTagsSetOfUnrelatedEntry() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifierToBeRemoved = 'identifier' . uniqid();
+               $identifierToBeRemoved = $this->getUniqueId('identifier');
                $tagToRemove = 'tag1';
                $this->backend->set($identifierToBeRemoved, 'data', array($tagToRemove));
-               $identifierNotToBeRemoved = 'identifier' . uniqid();
+               $identifierNotToBeRemoved = $this->getUniqueId('identifier');
                $tagNotToRemove = 'tag2';
                $this->backend->set($identifierNotToBeRemoved, 'data', array($tagNotToRemove));
                $this->backend->flushByTag($tagToRemove);
@@ -731,7 +731,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function flushByTagRemovesTagToIdentifiersSetOfGivenTag() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $tag = 'tag1';
                $this->backend->set($identifier, 'data', array($tag));
                $this->backend->flushByTag($tag);
@@ -744,7 +744,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function flushByTagRemovesIdentifiersTaggedWithGivenTagFromTagToIdentifiersSets() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier . 'A', 'data', array('tag1', 'tag2'));
                $this->backend->set($identifier . 'B', 'data', array('tag1', 'tag2'));
                $this->backend->set($identifier . 'C', 'data', array('tag2'));
@@ -758,7 +758,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function collectGarbageDoesNotRemoveNotExpiredIdentifierToDataEntry() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier . 'A', 'data', array('tag'));
                $this->backend->set($identifier . 'B', 'data', array('tag'));
                $this->redis->delete('identData:' . $identifier . 'A');
@@ -772,7 +772,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function collectGarbageRemovesLeftOverIdentifierToTagsSet() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier . 'A', 'data', array('tag'));
                $this->backend->set($identifier . 'B', 'data', array('tag'));
                $this->redis->delete('identData:' . $identifier . 'A');
@@ -791,7 +791,7 @@ class RedisBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function collectGarbageRemovesExpiredIdentifierFromTagsToIdentifierSet() {
                $this->setUpBackend();
                $this->setUpRedis();
-               $identifier = 'identifier' . uniqid();
+               $identifier = $this->getUniqueId('identifier');
                $this->backend->set($identifier . 'A', 'data', array('tag1', 'tag2'));
                $this->backend->set($identifier . 'B', 'data', array('tag2'));
                $this->redis->delete('identData:' . $identifier . 'A');
index 15818cc..bd9dcfe 100644 (file)
@@ -109,7 +109,7 @@ class Typo3DatabaseBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class, array(), array(), '', FALSE);
 
                $backend->expects($this->once())->method('remove');
-               $data = uniqid('someData');
+               $data = $this->getUniqueId('someData');
                $entryIdentifier = 'anIdentifier';
                $backend->set($entryIdentifier, $data, array(), 500);
        }
@@ -538,4 +538,4 @@ class Typo3DatabaseBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $backend->flushByTag('UnitTestTag%special');
        }
 
-}
\ No newline at end of file
+}
index ed12223..a439297 100644 (file)
@@ -41,7 +41,7 @@ class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setThrowsExceptionIfNoFrontEndHasBeenSet() {
                $backend = new WincacheBackend('Testing');
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
        }
 
@@ -51,7 +51,7 @@ class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToSetAndCheckExistenceInCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $inCache = $backend->has($identifier);
                $this->assertTrue($inCache, 'WinCache backend failed to set and check entry');
@@ -63,7 +63,7 @@ class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToSetAndGetEntry() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $fetchedData = $backend->get($identifier);
                $this->assertEquals($data, $fetchedData, 'Winache backend failed to set and retrieve data');
@@ -75,7 +75,7 @@ class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToRemoveEntryFromCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $backend->remove($identifier);
                $inCache = $backend->has($identifier);
@@ -88,7 +88,7 @@ class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToOverwriteAnEntryInTheCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $otherData = 'some other data';
                $backend->set($identifier, $otherData);
@@ -102,7 +102,7 @@ class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function findIdentifiersByTagFindsSetEntries() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data, array('UnitTestTag%tag1', 'UnitTestTag%tag2'));
                $retrieved = $backend->findIdentifiersByTag('UnitTestTag%tag1');
                $this->assertEquals($identifier, $retrieved[0], 'Could not retrieve expected entry by tag.');
@@ -116,7 +116,7 @@ class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setRemovesTagsFromPreviousSet() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data, array('UnitTestTag%tag1', 'UnitTestTag%tagX'));
                $backend->set($identifier, $data, array('UnitTestTag%tag3'));
                $retrieved = $backend->findIdentifiersByTag('UnitTestTag%tagX');
@@ -128,7 +128,7 @@ class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function hasReturnsFalseIfTheEntryDoesntExist() {
                $backend = $this->setUpBackend();
-               $identifier = 'NonExistingIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('NonExistingIdentifier');
                $inCache = $backend->has($identifier);
                $this->assertFalse($inCache, '"has" did not return FALSE when checking on non existing identifier');
        }
@@ -138,7 +138,7 @@ class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function removeReturnsFalseIfTheEntryDoesntExist() {
                $backend = $this->setUpBackend();
-               $identifier = 'NonExistingIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('NonExistingIdentifier');
                $inCache = $backend->remove($identifier);
                $this->assertFalse($inCache, '"remove" did not return FALSE when checking on non existing identifier');
        }
@@ -203,7 +203,7 @@ class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function largeDataIsStored() {
                $backend = $this->setUpBackend();
                $data = str_repeat('abcde', 1024 * 1024);
-               $identifier = 'tooLargeData' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('tooLargeData');
                $backend->set($identifier, $data);
                $this->assertTrue($backend->has($identifier));
                $this->assertEquals($backend->get($identifier), $data);
@@ -213,7 +213,7 @@ class WincacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function setTagsOnlyOnceToIdentifier() {
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $tags = array('UnitTestTag%test', 'UnitTestTag%boring');
 
                $backend = $this->setUpBackend(TRUE);
index 4851e11..0a4f42c 100644 (file)
@@ -44,7 +44,7 @@ class XcacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setThrowsExceptionIfNoFrontEndHasBeenSet() {
                $backend = new XcacheBackend('Testing');
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
        }
 
@@ -54,7 +54,7 @@ class XcacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToSetAndCheckExistenceInCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $inCache = $backend->has($identifier);
                $this->assertTrue($inCache, 'xcache backend failed to set and check entry');
@@ -66,7 +66,7 @@ class XcacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToSetAndGetEntry() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $fetchedData = $backend->get($identifier);
                $this->assertEquals($data, $fetchedData, 'xcache backend failed to set and retrieve data');
@@ -78,7 +78,7 @@ class XcacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToRemoveEntryFromCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $backend->remove($identifier);
                $inCache = $backend->has($identifier);
@@ -91,7 +91,7 @@ class XcacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function itIsPossibleToOverwriteAnEntryInTheCache() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data);
                $otherData = 'some other data';
                $backend->set($identifier, $otherData);
@@ -105,7 +105,7 @@ class XcacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function findIdentifiersByTagFindsSetEntries() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data, array('UnitTestTag%tag1', 'UnitTestTag%tag2'));
                $retrieved = $backend->findIdentifiersByTag('UnitTestTag%tag1');
                $this->assertEquals($identifier, $retrieved[0], 'Could not retrieve expected entry by tag.');
@@ -119,7 +119,7 @@ class XcacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function setRemovesTagsFromPreviousSet() {
                $backend = $this->setUpBackend();
                $data = 'Some data';
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $backend->set($identifier, $data, array('UnitTestTag%tag1', 'UnitTestTag%tagX'));
                $backend->set($identifier, $data, array('UnitTestTag%tag3'));
                $retrieved = $backend->findIdentifiersByTag('UnitTestTag%tagX');
@@ -131,7 +131,7 @@ class XcacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function hasReturnsFalseIfTheEntryDoesntExist() {
                $backend = $this->setUpBackend();
-               $identifier = 'NonExistingIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('NonExistingIdentifier');
                $inCache = $backend->has($identifier);
                $this->assertFalse($inCache, '"has" did not return FALSE when checking on non existing identifier');
        }
@@ -141,7 +141,7 @@ class XcacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function removeReturnsFalseIfTheEntryDoesntExist() {
                $backend = $this->setUpBackend();
-               $identifier = 'NonExistingIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('NonExistingIdentifier');
                $inCache = $backend->remove($identifier);
                $this->assertFalse($inCache, '"remove" did not return FALSE when checking on non existing identifier');
        }
@@ -206,7 +206,7 @@ class XcacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function largeDataIsStored() {
                $backend = $this->setUpBackend();
                $data = str_repeat('abcde', 1024 * 1024);
-               $identifier = 'tooLargeData' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('tooLargeData');
                $backend->set($identifier, $data);
                $this->assertTrue($backend->has($identifier));
                $this->assertEquals($backend->get($identifier), $data);
@@ -216,7 +216,7 @@ class XcacheBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function setTagsOnlyOnceToIdentifier() {
-               $identifier = 'MyIdentifier' . md5(uniqid(mt_rand(), TRUE));
+               $identifier = $this->getUniqueId('MyIdentifier');
                $tags = array('UnitTestTag%test', 'UnitTestTag%boring');
 
                $backend = $this->setUpBackend(TRUE);
index ad0c153..c8e565f 100644 (file)
@@ -129,7 +129,7 @@ class CacheManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getCacheCreatesCacheInstanceWithGivenConfiguration() {
                $manager = new \TYPO3\CMS\Core\Cache\CacheManager();
-               $cacheIdentifier = 'Test' . md5(uniqid(mt_rand(), TRUE));
+               $cacheIdentifier = $this->getUniqueId('Test');
                $cacheObjectName = 'testCache';
                $backendObjectName = 'testBackend';
                $backendOptions = array('foo');
@@ -152,7 +152,7 @@ class CacheManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getCacheCreatesCacheInstanceWithFallbackToDefaultFrontend() {
                $manager = new \TYPO3\CMS\Core\Cache\CacheManager();
-               $cacheIdentifier = 'Test' . md5(uniqid(mt_rand(), TRUE));
+               $cacheIdentifier = $this->getUniqueId('Test');
                $backendObjectName = 'testBackend';
                $backendOptions = array('foo');
                $configuration = array(
@@ -173,7 +173,7 @@ class CacheManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getCacheCreatesCacheInstanceWithFallbackToDefaultBackend() {
                $manager = new \TYPO3\CMS\Core\Cache\CacheManager();
-               $cacheIdentifier = 'Test' . md5(uniqid(mt_rand(), TRUE));
+               $cacheIdentifier = $this->getUniqueId('Test');
                $cacheObjectName = 'testCache';
                $backendOptions = array('foo');
                $configuration = array(
@@ -194,7 +194,7 @@ class CacheManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getCacheCreatesCacheInstanceWithFallbackToDefaultBackenOptions() {
                $manager = new \TYPO3\CMS\Core\Cache\CacheManager();
-               $cacheIdentifier = 'Test' . md5(uniqid(mt_rand(), TRUE));
+               $cacheIdentifier = $this->getUniqueId('Test');
                $cacheObjectName = 'testCache';
                $backendObjectName = 'testBackend';
                $configuration = array(
index 912a85b..b24b16b 100644 (file)
@@ -40,8 +40,8 @@ class CategoryRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $GLOBALS['TCA']['pages']['columns'] = array();
                $this->subject = new \TYPO3\CMS\Core\Category\CategoryRegistry();
                $this->tables = array(
-                       'first' => uniqid('first'),
-                       'second' => uniqid('second')
+                       'first' => $this->getUniqueId('first'),
+                       'second' => $this->getUniqueId('second')
                );
                foreach ($this->tables as $tableName) {
                        $GLOBALS['TCA'][$tableName] = array(
index fcb7552..917cba1 100644 (file)
@@ -56,7 +56,7 @@ class RecordCollectionRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                );
                $this->fixture = $this->getMock(\TYPO3\CMS\Core\Collection\RecordCollectionRepository::class, array('getDatabaseConnection'));
                $this->fixture->expects($this->any())->method('getDatabaseConnection')->will($this->returnValue($this->databaseMock));
-               $this->testTableName = uniqid('tx_testtable');
+               $this->testTableName = $this->getUniqueId('tx_testtable');
        }
 
        /**
@@ -94,7 +94,7 @@ class RecordCollectionRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $this->databaseMock->expects($this->once())->method('exec_SELECTgetSingleRow')->will($this->returnCallback(array($this, 'getSingleRowCallback')));
                $this->getSingleRowCallbackReturnValue = array(
                        'uid' => $testUid,
-                       'type' => uniqid('unknown')
+                       'type' => $this->getUniqueId('unknown')
                );
                $object = $this->fixture->findByUid($testUid);
        }
@@ -131,7 +131,7 @@ class RecordCollectionRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function doesFindByTableNameReturnNull() {
-               $testTable = uniqid('sys_collection_');
+               $testTable = $this->getUniqueId('sys_collection_');
                $this->databaseMock->expects($this->once())->method('exec_SELECTgetRows')->will($this->returnCallback(array($this, 'getRowsCallback')));
                $this->getRowsCallbackReturnValue = NULL;
                $objects = $this->fixture->findByTableName($testTable);
@@ -143,7 +143,7 @@ class RecordCollectionRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function doesFindByTableNameReturnObjects() {
                $testUid = rand(1, 1000);
-               $testTable = uniqid('sys_collection_');
+               $testTable = $this->getUniqueId('sys_collection_');
                $type = \TYPO3\CMS\Core\Collection\RecordCollectionRepository::TYPE_Static;
                $this->databaseMock->expects($this->once())->method('exec_SELECTgetRows')->will($this->returnCallback(array($this, 'getRowsCallback')));
                $this->getRowsCallbackReturnValue = array(
@@ -160,7 +160,7 @@ class RecordCollectionRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function doesFindByTypeAndTableNameReturnNull() {
-               $testTable = uniqid('sys_collection_');
+               $testTable = $this->getUniqueId('sys_collection_');
                $type = \TYPO3\CMS\Core\Collection\RecordCollectionRepository::TYPE_Static;
                $this->databaseMock->expects($this->once())->method('exec_SELECTgetRows')->will($this->returnCallback(array($this, 'getRowsCallback')));
                $this->getRowsCallbackReturnValue = NULL;
@@ -173,7 +173,7 @@ class RecordCollectionRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function doesFindByTypeAndTableNameReturnObjects() {
                $testUid = rand(1, 1000);
-               $testTable = uniqid('sys_collection_');
+               $testTable = $this->getUniqueId('sys_collection_');
                $type = \TYPO3\CMS\Core\Collection\RecordCollectionRepository::TYPE_Static;
                $this->databaseMock->expects($this->once())->method('exec_SELECTgetRows')->will($this->returnCallback(array($this, 'getRowsCallback')));
                $this->getRowsCallbackReturnValue = array(
index 07fde16..1079351 100644 (file)
@@ -50,7 +50,7 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \RuntimeException
         */
        public function getDefaultConfigurationExecutesDefinedDefaultConfigurationFile() {
-               $defaultConfigurationFile = PATH_site . 'typo3temp/' . uniqid('defaultConfiguration');
+               $defaultConfigurationFile = PATH_site . 'typo3temp/' . $this->getUniqueId('defaultConfiguration');
                file_put_contents(
                        $defaultConfigurationFile,
                        '<?php throw new \RuntimeException(\'foo\', 1310203814); ?>'
@@ -69,7 +69,7 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \RuntimeException
         */
        public function getLocalConfigurationExecutesDefinedConfigurationFile() {
-               $configurationFile = PATH_site . 'typo3temp/' . uniqid('localConfiguration');
+               $configurationFile = PATH_site . 'typo3temp/' . $this->getUniqueId('localConfiguration');
                file_put_contents(
                        $configurationFile,
                        '<?php throw new \RuntimeException(\'foo\', 1310203815); ?>'
@@ -357,7 +357,7 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                /** @var $fixture \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $fixture = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, array('dummy'));
 
-               $directory = 'typo3temp/' . uniqid('test_');
+               $directory = 'typo3temp/' . $this->getUniqueId('test_');
                $absoluteDirectory = PATH_site . $directory;
                mkdir($absoluteDirectory);
                chmod($absoluteDirectory, 0544);
@@ -385,7 +385,7 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                /** @var $fixture \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $fixture = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, array('dummy'));
 
-               $file = 'typo3temp/' . uniqid('test_');
+               $file = 'typo3temp/' . $this->getUniqueId('test_');
                $absoluteFile = PATH_site . $file;
                touch($absoluteFile);
                $this->testFilesToDelete[] = $absoluteFile;
@@ -408,18 +408,18 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                /** @var $fixture \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $fixture = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, array('dummy'));
 
-               $directory = 'typo3temp/' . uniqid('test_');
+               $directory = 'typo3temp/' . $this->getUniqueId('test_');
                $absoluteDirectory = PATH_site . $directory;
                mkdir($absoluteDirectory);
                $fixture->_set('pathTypo3Conf', $absoluteDirectory);
 
-               $file1 = 'typo3temp/' . uniqid('test_');
+               $file1 = 'typo3temp/' . $this->getUniqueId('test_');
                $absoluteFile1 = PATH_site . $file1;
                touch($absoluteFile1);
                $this->testFilesToDelete[] = $absoluteFile1;
                $fixture->_set('localConfigurationFile', $absoluteFile1);
 
-               $file2 = 'typo3temp/' . uniqid('test_');
+               $file2 = 'typo3temp/' . $this->getUniqueId('test_');
                $absoluteFile2 = PATH_site . $file2;
                touch($absoluteFile2);
                $this->testFilesToDelete[] = $absoluteFile2;
@@ -437,7 +437,7 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function writeLocalConfigurationWritesSortedContentToConfigurationFile() {
-               $configurationFile = PATH_site . 'typo3temp/' . uniqid('localConfiguration');
+               $configurationFile = PATH_site . 'typo3temp/' . $this->getUniqueId('localConfiguration');
                if (!is_file($configurationFile)) {
                        if (!$fh = fopen($configurationFile, 'wb')) {
                                $this->markTestSkipped('Can not create file ' . $configurationFile . '. Please check your write permissions.');
@@ -479,7 +479,7 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                /** @var $fixture \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $fixture = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, array('dummy'));
 
-               $file = 'typo3temp/' . uniqid('test_');
+               $file = 'typo3temp/' . $this->getUniqueId('test_');
                $absoluteFile = PATH_site . $file;
                touch($absoluteFile);
                $this->testFilesToDelete[] = $absoluteFile;
@@ -494,11 +494,11 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function createLocalConfigurationFromFactoryConfigurationWritesContentFromFactoryFile() {
                /** @var $fixture \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $fixture = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, array('writeLocalConfiguration'));
-               $fixture->_set('localConfigurationFile', 'typo3temp/' . uniqid('dummy_'));
+               $fixture->_set('localConfigurationFile', 'typo3temp/' . $this->getUniqueId('dummy_'));
 
-               $factoryConfigurationFile = 'typo3temp/' . uniqid('test_') . '.php';
+               $factoryConfigurationFile = 'typo3temp/' . $this->getUniqueId('test_') . '.php';
                $factoryConfigurationAbsoluteFile = PATH_site . $factoryConfigurationFile;
-               $uniqueContentString = uniqid('string_');
+               $uniqueContentString = $this->getUniqueId('string_');
                $validFactoryConfigurationFileContent =
                        '<?php' . LF .
                                'return array(' . LF .
@@ -526,9 +526,9 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function createLocalConfigurationFromFactoryConfigurationMergesConfigurationWithAdditionalFactoryFile() {
                /** @var $fixture \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $fixture = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, array('writeLocalConfiguration'));
-               $fixture->_set('localConfigurationFile', 'typo3temp/' . uniqid('dummy_'));
+               $fixture->_set('localConfigurationFile', 'typo3temp/' . $this->getUniqueId('dummy_'));
 
-               $factoryConfigurationFile = 'typo3temp/' . uniqid('test_') . '.php';
+               $factoryConfigurationFile = 'typo3temp/' . $this->getUniqueId('test_') . '.php';
                $factoryConfigurationAbsoluteFile = PATH_site . $factoryConfigurationFile;
                $validFactoryConfigurationFileContent =
                        '<?php' . LF .
@@ -541,9 +541,9 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->testFilesToDelete[] = $factoryConfigurationAbsoluteFile;
                $fixture->_set('factoryConfigurationFile', $factoryConfigurationFile);
 
-               $additionalFactoryConfigurationFile = 'typo3temp/' . uniqid('test_') . '.php';
+               $additionalFactoryConfigurationFile = 'typo3temp/' . $this->getUniqueId('test_') . '.php';
                $additionalFactoryConfigurationAbsoluteFile = PATH_site . $additionalFactoryConfigurationFile;
-               $uniqueContentString = uniqid('string_');
+               $uniqueContentString = $this->getUniqueId('string_');
                $validAdditionalFactoryConfigurationFileContent =
                        '<?php' . LF .
                                'return array(' . LF .
index 7163aab..ab14c0c 100644 (file)
@@ -91,7 +91,7 @@ class ClassLoaderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @return string The extension key
         */
        protected function createFakeExtension() {
-               $extKey = strtolower(uniqid('testing'));
+               $extKey = strtolower($this->getUniqueId('testing'));
                $absExtPath = PATH_site . 'typo3temp/' . $extKey . '/';
                $relPath = 'typo3temp/' . $extKey . '/';
                \TYPO3\CMS\Core\Utility\GeneralUtility::mkdir($absExtPath);
index d9840ef..ce1948f 100644 (file)
@@ -41,7 +41,7 @@ class SystemEnvironmentBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @return array
         */
        public function fileDenyPatternMatchesPhpExtensionDataProvider() {
-               $fileName = uniqid('filename');
+               $fileName = $this->getUniqueId('filename');
                $data = array();
                $phpExtensions = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', 'php,php3,php4,php5,php6,phpsh,phtml', TRUE);
                foreach ($phpExtensions as $extension) {
@@ -66,7 +66,7 @@ class SystemEnvironmentBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function getPathThisScriptCliReadsLocalPartFromArgv() {
-               $fakedLocalPart = uniqid('Test');
+               $fakedLocalPart = $this->getUniqueId('Test');
                $GLOBALS['_SERVER']['argv'][0] = $fakedLocalPart;
                $this->assertStringEndsWith($fakedLocalPart, $this->fixture->_call('getPathThisScriptCli'));
        }
@@ -75,7 +75,7 @@ class SystemEnvironmentBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function getPathThisScriptCliReadsLocalPartFromEnv() {
-               $fakedLocalPart = uniqid('Test');
+               $fakedLocalPart = $this->getUniqueId('Test');
                unset($GLOBALS['_SERVER']['argv']);
                $GLOBALS['_ENV']['_'] = $fakedLocalPart;
                $this->assertStringEndsWith($fakedLocalPart, $this->fixture->_call('getPathThisScriptCli'));
@@ -85,7 +85,7 @@ class SystemEnvironmentBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function getPathThisScriptCliReadsLocalPartFromServer() {
-               $fakedLocalPart = uniqid('Test');
+               $fakedLocalPart = $this->getUniqueId('Test');
                unset($GLOBALS['_SERVER']['argv']);
                unset($GLOBALS['_ENV']['_']);
                $GLOBALS['_SERVER']['_'] = $fakedLocalPart;
@@ -100,7 +100,7 @@ class SystemEnvironmentBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('Test not available on Windows OS.');
                }
                $GLOBALS['_SERVER']['argv'][0] = 'foo';
-               $fakedAbsolutePart = '/' . uniqid('Absolute') . '/';
+               $fakedAbsolutePart = '/' . $this->getUniqueId('Absolute') . '/';
                $_SERVER['PWD'] = $fakedAbsolutePart;
                $this->assertStringStartsWith($fakedAbsolutePart, $this->fixture->_call('getPathThisScriptCli'));
        }
index 7641198..93b3e8b 100644 (file)
@@ -126,7 +126,7 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function nonAdminWithTableModifyAccessIsNotAllowedToModifyAdminTable() {
-               $tableName = uniqid('aTable');
+               $tableName = $this->getUniqueId('aTable');
                $GLOBALS['TCA'] = array(
                        $tableName => array(
                                'ctrl' => array(
@@ -267,7 +267,7 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \UnexpectedValueException
         */
        public function doesCheckModifyAccessListThrowExceptionOnWrongHookInterface() {
-               $hookClass = uniqid('tx_coretest');
+               $hookClass = $this->getUniqueId('tx_coretest');
                eval('class ' . $hookClass . ' {}');
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'][] = $hookClass;
                $this->subject->checkModifyAccessList('tt_content');
@@ -279,7 +279,7 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function doesCheckModifyAccessListHookGetsCalled() {
-               $hookClass = uniqid('tx_coretest');
+               $hookClass = $this->getUniqueId('tx_coretest');
                $hookMock = $this->getMock(\TYPO3\CMS\Core\DataHandling\DataHandlerCheckModifyAccessListHookInterface::class, array('checkModifyAccessList'), array(), $hookClass);
                $hookMock->expects($this->once())->method('checkModifyAccessList');
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkModifyAccessList'][] = $hookClass;
@@ -293,7 +293,7 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function doesCheckModifyAccessListHookModifyAccessAllowed() {
-               $hookClass = uniqid('tx_coretest');
+               $hookClass = $this->getUniqueId('tx_coretest');
                eval('
                        class ' . $hookClass . ' implements \\TYPO3\\CMS\\Core\\DataHandling\\DataHandlerCheckModifyAccessListHookInterface {
                                public function checkModifyAccessList(&$accessAllowed, $table, \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $parent) { $accessAllowed = TRUE; }
@@ -380,7 +380,7 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function doesCheckFlexFormValueHookGetsCalled() {
-               $hookClass = uniqid('tx_coretest');
+               $hookClass = $this->getUniqueId('tx_coretest');
                $hookMock = $this->getMock($hookClass, array('checkFlexFormValue_beforeMerge'));
                $hookMock->expects($this->once())->method('checkFlexFormValue_beforeMerge');
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['checkFlexFormValue'][] = $hookClass;
@@ -421,7 +421,7 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->subject->BE_USER = $backendUser;
                $this->subject->enableLogging = TRUE;
                $this->subject->errorLog = array();
-               $logDetailsUnique = uniqid('details');
+               $logDetailsUnique = $this->getUniqueId('details');
                $this->subject->log('', 23, 0, 42, 1, $logDetailsUnique);
                $this->assertStringEndsWith($logDetailsUnique, $this->subject->errorLog[0]);
        }
@@ -434,7 +434,7 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->subject->BE_USER = $backendUser;
                $this->subject->enableLogging = TRUE;
                $this->subject->errorLog = array();
-               $logDetails = uniqid('details');
+               $logDetails = $this->getUniqueId('details');
                $this->subject->log('', 23, 0, 42, 1, '%1s' . $logDetails . '%2s', -1, array('foo', 'bar'));
                $expected = 'foo' . $logDetails . 'bar';
                $this->assertStringEndsWith($expected, $this->subject->errorLog[0]);
@@ -699,10 +699,10 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function deleteRecord_procBasedOnFieldTypeRespectsEnableCascadingDelete() {
-               $table = uniqid('foo_');
+               $table = $this->getUniqueId('foo_');
                $conf = array(
                        'type' => 'inline',
-                       'foreign_table' => uniqid('foreign_foo_'),
+                       'foreign_table' => $this->getUniqueId('foreign_foo_'),
                        'behaviour' => array(
                                'enableCascadingDelete' => 0,
                        )
@@ -711,7 +711,7 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                /** @var \TYPO3\CMS\Core\Database\RelationHandler $mockRelationHandler */
                $mockRelationHandler = $this->getMock(\TYPO3\CMS\Core\Database\RelationHandler::class, array(), array(), '', FALSE);
                $mockRelationHandler->itemArray = array(
-                       '1' => array('table' => uniqid('bar_'), 'id' => 67)
+                       '1' => array('table' => $this->getUniqueId('bar_'), 'id' => 67)
                );
 
                /** @var DataHandler|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $mockDataHandler */
index b02acd8..5c11760 100644 (file)
@@ -136,7 +136,7 @@ class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function persistSessionTokenWritesTokenToSession() {
-               $sessionToken = uniqid('test_');
+               $sessionToken = $this->getUniqueId('test_');
                $this->subject->_set('sessionToken', $sessionToken);
                $this->getBackendUser()
                        ->expects($this->once())
index 7258b3a..a5084b3 100644 (file)
@@ -55,7 +55,7 @@ class FormProtectionFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getForTypeBackEndWithExistingBackEndReturnsBackEndFormProtection() {
                $GLOBALS['BE_USER'] = $this->getMock(\TYPO3\CMS\Core\Authentication\BackendUserAuthentication::class, array(), array(), '', FALSE);
-               $GLOBALS['BE_USER']->user = array('uid' => uniqid());
+               $GLOBALS['BE_USER']->user = array('uid' => $this->getUniqueId());
                $this->assertTrue(\TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(\TYPO3\CMS\Core\FormProtection\BackendFormProtection::class) instanceof \TYPO3\CMS\Core\FormProtection\BackendFormProtection);
        }
 
@@ -64,7 +64,7 @@ class FormProtectionFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getForTypeBackEndCalledTwoTimesReturnsTheSameInstance() {
                $GLOBALS['BE_USER'] = $this->getMock(\TYPO3\CMS\Core\Authentication\BackendUserAuthentication::class, array(), array(), '', FALSE);
-               $GLOBALS['BE_USER']->user = array('uid' => uniqid());
+               $GLOBALS['BE_USER']->user = array('uid' => $this->getUniqueId());
                $this->assertSame(\TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(\TYPO3\CMS\Core\FormProtection\BackendFormProtection::class), \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(\TYPO3\CMS\Core\FormProtection\BackendFormProtection::class));
        }
 
@@ -87,7 +87,7 @@ class FormProtectionFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getForTypesInstallToolAndBackEndReturnsDifferentInstances() {
                $GLOBALS['BE_USER'] = $this->getMock(\TYPO3\CMS\Core\Authentication\BackendUserAuthentication::class, array(), array(), '', FALSE);
-               $GLOBALS['BE_USER']->user = array('uid' => uniqid());
+               $GLOBALS['BE_USER']->user = array('uid' => $this->getUniqueId());
                $this->assertNotSame(\TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(\TYPO3\CMS\Core\FormProtection\InstallToolFormProtection::class), \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(\TYPO3\CMS\Core\FormProtection\BackendFormProtection::class));
        }
 
index 8efddcc..8c6b0da 100644 (file)
@@ -61,7 +61,7 @@ class LogManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function managerReturnsSameLoggerOnRepeatedRequest() {
-               $loggerName = uniqid('test.core.log');
+               $loggerName = $this->getUniqueId('test.core.log');
                $this->logManagerInstance->registerLogger($loggerName);
                $logger1 = $this->logManagerInstance->getLogger($loggerName);
                $logger2 = $this->logManagerInstance->getLogger($loggerName);
index 0969613..fca0718 100644 (file)
@@ -25,7 +25,7 @@ class DatabaseWriterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function getTableReturnsPreviouslySetTable() {
-               $logTable = uniqid('logtable_');
+               $logTable = $this->getUniqueId('logtable_');
                /** @var \TYPO3\CMS\Core\Log\Writer\DatabaseWriter|\PHPUnit_Framework_MockObject_MockObject $subject */
                $subject = $this->getMock(\TYPO3\CMS\Core\Log\Writer\DatabaseWriter::class, array('dummy'), array(), '', FALSE);
                $subject->setLogTable($logTable);
@@ -50,7 +50,7 @@ class DatabaseWriterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function writeLogInsertsToSpecifiedTable() {
-               $logTable = uniqid('logtable_');
+               $logTable = $this->getUniqueId('logtable_');
                $GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class, array(), array(), '', FALSE);
                $GLOBALS['TYPO3_DB']->expects($this->once())->method('exec_INSERTquery')->with($logTable, $this->anything());
                /** @var \TYPO3\CMS\Core\Log\LogRecord|\PHPUnit_Framework_MockObject_MockObject $subject */
@@ -66,11 +66,11 @@ class DatabaseWriterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function writeLogInsertsLogRecordWithGivenProperties() {
                $logRecordData = array(
-                       'request_id' => uniqid('request_id'),
-                       'time_micro' => uniqid('time_micro'),
-                       'component' => uniqid('component'),
-                       'level' => uniqid('level'),
-                       'message' => uniqid('message'),
+                       'request_id' => $this->getUniqueId('request_id'),
+                       'time_micro' => $this->getUniqueId('time_micro'),
+                       'component' => $this->getUniqueId('component'),
+                       'level' => $this->getUniqueId('level'),
+                       'message' => $this->getUniqueId('message'),
                        'data' => '',
                );
                /** @var \TYPO3\CMS\Core\Log\LogRecord|\PHPUnit_Framework_MockObject_MockObject $subject */
index 2ffac01..2aa9d3a 100644 (file)
@@ -51,7 +51,7 @@ class FileWriterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        protected function createLogger($name = '') {
                if (empty($name)) {
-                       $name = uniqid('test.core.log.');
+                       $name = $this->getUniqueId('test.core.log.');
                }
                \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogManager::class)->registerLogger($name);
                /** @var \TYPO3\CMS\Core\Log\Logger $logger */
@@ -119,8 +119,8 @@ class FileWriterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @return array
         */
        public function logsToFileDataProvider() {
-               $simpleRecord = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogRecord::class, uniqid('test.core.log.fileWriter.simpleRecord.'), \TYPO3\CMS\Core\Log\LogLevel::INFO, 'test record');
-               $recordWithData = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogRecord::class, uniqid('test.core.log.fileWriter.recordWithData.'), \TYPO3\CMS\Core\Log\LogLevel::ALERT, 'test record with data', array('foo' => array('bar' => 'baz')));
+               $simpleRecord = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogRecord::class, $this->getUniqueId('test.core.log.fileWriter.simpleRecord.'), \TYPO3\CMS\Core\Log\LogLevel::INFO, 'test record');
+               $recordWithData = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogRecord::class, $this->getUniqueId('test.core.log.fileWriter.recordWithData.'), \TYPO3\CMS\Core\Log\LogLevel::ALERT, 'test record with data', array('foo' => array('bar' => 'baz')));
                return array(
                        'simple record' => array($simpleRecord, trim((string)$simpleRecord)),
                        'record with data' => array($recordWithData, trim((string)$recordWithData))
@@ -172,7 +172,7 @@ class FileWriterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
                $secondWriter->expects($this->never())->method('createLogFile');
 
-               $logFilePrefix = uniqid('unique');
+               $logFilePrefix = $this->getUniqueId('unique');
                $firstWriter->setLogFile($this->getDefaultFileName($logFilePrefix));
                $secondWriter->setLogFile($this->getDefaultFileName($logFilePrefix));
 
@@ -183,7 +183,7 @@ class FileWriterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function createsHtaccessForNewDirectory() {
                $this->setUpVfsStream();
-               $directory = uniqid('Log');
+               $directory = $this->getUniqueId('Log');
                $logFile = 'vfs://LogRoot/' . $directory . '/' . $this->logFileName;
                $this->createWriter()->setLogFile($logFile);
                $this->assertFileExists('vfs://LogRoot/' . $directory . '/.htaccess');
@@ -194,7 +194,7 @@ class FileWriterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function createsNoHtaccessForExistingDirectory() {
                $this->setUpVfsStream();
-               $directory = uniqid('Log');
+               $directory = $this->getUniqueId('Log');
                        // create a directory
                vfsStreamWrapper::getRoot()->addChild(new vfsStreamDirectory($directory));
                $logFile = 'vfs://LogRoot/' . $directory . '/' . $this->logFileName;
index cd3d781..f071e68 100644 (file)
@@ -145,10 +145,10 @@ class PackageManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function scanAvailablePackagesTraversesThePackagesDirectoryAndRegistersPackagesItFinds() {
                $expectedPackageKeys = array(
-                       'TYPO3.Flow' . md5(uniqid(mt_rand(), TRUE)),
-                       'TYPO3.Flow.Test' . md5(uniqid(mt_rand(), TRUE)),
-                       'TYPO3.YetAnotherTestPackage' . md5(uniqid(mt_rand(), TRUE)),
-                       'RobertLemke.Flow.NothingElse' . md5(uniqid(mt_rand(), TRUE))
+                       $this->getUniqueId('TYPO3.Flow'),
+                       $this->getUniqueId('TYPO3.Flow.Test'),
+                       $this->getUniqueId('TYPO3.YetAnotherTestPackage'),
+                       $this->getUniqueId('RobertLemke.Flow.NothingElse')
                );
 
                foreach ($expectedPackageKeys as $packageKey) {
@@ -179,10 +179,10 @@ class PackageManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function scanAvailablePackagesKeepsExistingPackageConfiguration() {
                $expectedPackageKeys = array(
-                       'TYPO3.Flow' . md5(uniqid(mt_rand(), TRUE)),
-                       'TYPO3.Flow.Test' . md5(uniqid(mt_rand(), TRUE)),
-                       'TYPO3.YetAnotherTestPackage' . md5(uniqid(mt_rand(), TRUE)),
-                       'RobertLemke.Flow.NothingElse' . md5(uniqid(mt_rand(), TRUE))
+                       $this->getUniqueId('TYPO3.Flow'),
+                       $this->getUniqueId('TYPO3.Flow.Test'),
+                       $this->getUniqueId('TYPO3.YetAnotherTestPackage'),
+                       $this->getUniqueId('RobertLemke.Flow.NothingElse')
                );
 
                foreach ($expectedPackageKeys as $packageKey) {
@@ -224,9 +224,9 @@ class PackageManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function packageStatesConfigurationContainsRelativePaths() {
                $packageKeys = array(
-                       'RobertLemke.Flow.NothingElse' . md5(uniqid(mt_rand(), TRUE)),
-                       'TYPO3.Flow' . md5(uniqid(mt_rand(), TRUE)),
-                       'TYPO3.YetAnotherTestPackage' . md5(uniqid(mt_rand(), TRUE)),
+                       $this->getUniqueId('RobertLemke.Flow.NothingElse'),
+                       $this->getUniqueId('TYPO3.Flow'),
+                       $this->getUniqueId('TYPO3.YetAnotherTestPackage')
                );
 
                foreach ($packageKeys as $packageKey) {
index 85ed94a..bb46585 100644 (file)
@@ -79,9 +79,9 @@ class PageRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function addInlineLanguageLabelFileSetsInlineLanguageLabelFiles() {
                /** @var \TYPO3\CMS\Core\Page\PageRenderer|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $subject */
                $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Page\PageRenderer::class, array('dummy'), array(), '', FALSE);
-               $fileReference = uniqid('file_');
-               $selectionPrefix = uniqid('prefix_');
-               $stripFromSelectionName = uniqid('strip_');
+               $fileReference = $this->getUniqueId('file_');
+               $selectionPrefix = $this->getUniqueId('prefix_');
+               $stripFromSelectionName = $this->getUniqueId('strip_');
                $errorMode = 0;
 
                $expectedInlineLanguageLabelFile = array(
@@ -103,9 +103,9 @@ class PageRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function addInlineLanguageLabelFileSetsTwoDifferentInlineLanguageLabelFiles() {
                /** @var \TYPO3\CMS\Core\Page\PageRenderer|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $subject */
                $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Page\PageRenderer::class, array('dummy'), array(), '', FALSE);
-               $fileReference1 = uniqid('file1_');
-               $selectionPrefix1 = uniqid('prefix1_');
-               $stripFromSelectionName1 = uniqid('strip1_');
+               $fileReference1 = $this->getUniqueId('file1_');
+               $selectionPrefix1 = $this->getUniqueId('prefix1_');
+               $stripFromSelectionName1 = $this->getUniqueId('strip1_');
                $errorMode1 = 0;
                $expectedInlineLanguageLabelFile1 = array(
                        'fileRef' => $fileReference1,
@@ -113,9 +113,9 @@ class PageRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        'stripFromSelectionName' => $stripFromSelectionName1,
                        'errorMode' => $errorMode1
                );
-               $fileReference2 = uniqid('file2_');
-               $selectionPrefix2 = uniqid('prefix2_');
-               $stripFromSelectionName2 = uniqid('strip2_');
+               $fileReference2 = $this->getUniqueId('file2_');
+               $selectionPrefix2 = $this->getUniqueId('prefix2_');
+               $stripFromSelectionName2 = $this->getUniqueId('strip2_');
                $errorMode2 = 0;
                $expectedInlineLanguageLabelFile2 = array(
                        'fileRef' => $fileReference2,
@@ -138,9 +138,9 @@ class PageRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function addInlineLanguageLabelFileDoesNotSetSameLanguageFileTwice() {
                /** @var \TYPO3\CMS\Core\Page\PageRenderer|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $subject */
                $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Page\PageRenderer::class, array('dummy'), array(), '', FALSE);
-               $fileReference = uniqid('file2_');
-               $selectionPrefix = uniqid('prefix2_');
-               $stripFromSelectionName = uniqid('strip2_');
+               $fileReference = $this->getUniqueId('file2_');
+               $selectionPrefix = $this->getUniqueId('prefix2_');
+               $stripFromSelectionName = $this->getUniqueId('strip2_');
                $errorMode = 0;
 
                $subject->addInlineLanguageLabelFile($fileReference, $selectionPrefix, $stripFromSelectionName, $errorMode);
index 32697fb..3f8bdc0 100644 (file)
@@ -33,8 +33,8 @@ abstract class BaseTestCase extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        protected $vfsContents = array();
 
        public function setUp() {
-               $this->mountDir = uniqid('mount-');
-               $this->basedir = uniqid('base-');
+               $this->mountDir = $this->getUniqueId('mount-');
+               $this->basedir = $this->getUniqueId('base-');
                vfsStream::setup($this->basedir);
                // Add an entry for the mount directory to the VFS contents
                $this->vfsContents = array($this->mountDir => array());
index 15bf997..b40fac6 100644 (file)
@@ -48,7 +48,7 @@ class FileCollectionRegistryTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\Bas
         * @expectedExceptionCode 1391295613
         */
        public function registerFileCollectionClassThrowsExceptionIfClassDoesNotExist() {
-               $this->testSubject->registerFileCollectionClass(uniqid(), uniqid());
+               $this->testSubject->registerFileCollectionClass($this->getUniqueId(), substr($this->getUniqueId(), 0, 30));
        }
 
        /**
@@ -90,7 +90,7 @@ class FileCollectionRegistryTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\Bas
         * @expectedExceptionCode 1391295644
         */
        public function getFileCollectionClassThrowsExceptionIfClassIsNotRegistered() {
-               $this->testSubject->getFileCollectionClass(uniqid());
+               $this->testSubject->getFileCollectionClass($this->getUniqueId());
        }
 
        /**
@@ -107,7 +107,7 @@ class FileCollectionRegistryTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\Bas
         */
        public function fileCollectionRegistryIsInitializedWithPreconfiguredFileCollections() {
                $className = get_class($this->getMockForAbstractClass(\TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection::class));
-               $type = uniqid();
+               $type = substr($this->getUniqueId(), 0, 30);
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredCollections'] = array(
                        $type => $className
                );
@@ -135,7 +135,7 @@ class FileCollectionRegistryTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\Bas
        public function fileCollectionExistsReturnsFalseIfFileCollectionDoesNotExist() {
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredFileCollections'] = array();
                $this->initializeTestSubject();
-               $this->assertFalse($this->testSubject->fileCollectionTypeExists(uniqid()));
+               $this->assertFalse($this->testSubject->fileCollectionTypeExists($this->getUniqueId()));
        }
 
        /**
index b4df8d0..b7b04d9 100644 (file)
@@ -49,7 +49,7 @@ class DriverRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function registerDriverClassThrowsExceptionIfClassDoesNotExist() {
                $this->setExpectedException('InvalidArgumentException', '', 1314979197);
-               $this->fixture->registerDriverClass(uniqid());
+               $this->fixture->registerDriverClass($this->getUniqueId());
        }
 
        /**
@@ -68,7 +68,7 @@ class DriverRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getDriverClassThrowsExceptionIfClassIsNotRegistered() {
                $this->setExpectedException('InvalidArgumentException', '', 1314085990);
-               $this->fixture->getDriverClass(uniqid());
+               $this->fixture->getDriverClass($this->getUniqueId());
        }
 
        /**
@@ -85,7 +85,7 @@ class DriverRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function driverRegistryIsInitializedWithPreconfiguredDrivers() {
                $className = get_class($this->getMockForAbstractClass(\TYPO3\CMS\Core\Resource\Driver\AbstractDriver::class));
-               $shortName = uniqid();
+               $shortName = $this->getUniqueId();
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredDrivers'] = array(
                        $shortName => array(
                                'class' => $className
@@ -100,7 +100,7 @@ class DriverRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function driverExistsReturnsTrueForAllExistingDrivers() {
                $className = get_class($this->getMockForAbstractClass(\TYPO3\CMS\Core\Resource\Driver\AbstractDriver::class));
-               $shortName = uniqid();
+               $shortName = $this->getUniqueId();
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredDrivers'] = array(
                        $shortName => array(
                                'class' => $className
@@ -108,7 +108,7 @@ class DriverRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                );
                $this->initializeFixture();
                $this->assertTrue($this->fixture->driverExists($shortName));
-               $this->assertFalse($this->fixture->driverExists(uniqid()));
+               $this->assertFalse($this->fixture->driverExists($this->getUniqueId()));
        }
 
        /**
@@ -118,7 +118,7 @@ class DriverRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredDrivers'] = array(
                );
                $this->initializeFixture();
-               $this->assertFalse($this->fixture->driverExists(uniqid()));
+               $this->assertFalse($this->fixture->driverExists($this->getUniqueId()));
        }
 
 }
index 133589d..3c221b4 100644 (file)
@@ -75,7 +75,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
         * @return string
         */
        protected function createRealTestdir() {
-               $basedir = PATH_site . 'typo3temp/' . uniqid('fal-test-');
+               $basedir = PATH_site . 'typo3temp/' . $this->getUniqueId('fal-test-');
                mkdir($basedir);
                $this->testDirs[] = $basedir;
                return $basedir;
@@ -405,7 +405,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
         * @test
         */
        public function getPublicUrlReturnsCorrectUriForConfiguredBaseUri() {
-               $baseUri = 'http://example.org/foobar/' . uniqid();
+               $baseUri = 'http://example.org/foobar/' . $this->getUniqueId();
                $this->addToMount(array(
                        'file.ext' => 'asdf',
                        'subfolder' => array(
@@ -438,7 +438,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
         * @dataProvider getPublicUrlReturnsValidUrlContainingSpecialCharacters_dataProvider
         */
        public function getPublicUrlReturnsValidUrlContainingSpecialCharacters($fileIdentifier) {
-               $baseUri = 'http://example.org/foobar/' . uniqid();
+               $baseUri = 'http://example.org/foobar/' . $this->getUniqueId();
                $fixture = $this->createDriverFixture(array(
                        'baseUri' => $baseUri
                ));
@@ -773,7 +773,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
        public function hashingWithUnsupportedAlgorithmFails() {
                $this->setExpectedException('InvalidArgumentException', '', 1304964032);
                $fixture = $this->createDriverFixture();
-               $fixture->hash('/hashFile', uniqid());
+               $fixture->hash('/hashFile', $this->getUniqueId());
        }
 
        /**
@@ -980,7 +980,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
         * @test
         */
        public function filesCanBeCopiedWithinStorage() {
-               $fileContents = uniqid();
+               $fileContents = $this->getUniqueId();
                $this->addToMount(array(
                        'someFile' => $fileContents,
                        'targetFolder' => array()
@@ -997,7 +997,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
         * @test
         */
        public function filesCanBeMovedWithinStorage() {
-               $fileContents = uniqid();
+               $fileContents = $this->getUniqueId();
                $this->addToMount(array(
                        'targetFolder' => array(),
                        'someFile' => $fileContents
@@ -1013,7 +1013,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
         * @test
         */
        public function fileMetadataIsChangedAfterMovingFile() {
-               $fileContents = uniqid();
+               $fileContents = $this->getUniqueId();
                $this->addToMount(array(
                        'targetFolder' => array(),
                        'someFile' => $fileContents
@@ -1197,7 +1197,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
         * @test
         */
        public function foldersCanBeMovedWithinStorage() {
-               $fileContents =  uniqid();
+               $fileContents = $this->getUniqueId();
                $this->addToMount(array(
                        'sourceFolder' => array(
                                'file' => $fileContents,
@@ -1237,7 +1237,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
        public function folderCanBeRenamedWhenMoving() {
                $this->addToMount(array(
                        'sourceFolder' => array(
-                               'file' => uniqid(),
+                               'file' => $this->getUniqueId(),
                        ),
                        'targetFolder' => array(),
                ));
@@ -1252,7 +1252,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
        public function copyFolderWithinStorageCopiesSingleFileToNewFolderName() {
                $this->addToMount(array(
                        'sourceFolder' => array(
-                               'file' => uniqid(),
+                               'file' => $this->getUniqueId(),
                        ),
                        'targetFolder' => array(),
                ));
@@ -1280,7 +1280,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
                list($basePath, $fixture) = $this->prepareRealTestEnvironment();
                GeneralUtility::mkdir_deep($basePath, '/sourceFolder/subFolder');
                GeneralUtility::mkdir_deep($basePath, '/targetFolder');
-               file_put_contents($basePath . '/sourceFolder/subFolder/file', uniqid());
+               file_put_contents($basePath . '/sourceFolder/subFolder/file', $this->getUniqueId());
                GeneralUtility::fixPermissions($basePath . '/sourceFolder/subFolder/file');
 
                $fixture->copyFolderWithinStorage('/sourceFolder/', '/targetFolder/', 'newFolderName');
index 2a860e8..61d4e68 100644 (file)
@@ -132,7 +132,7 @@ class FileReferenceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getPropertyThrowsExceptionForNotAvailableProperty($fileReferenceProperties, $originalFileProperties) {
                $fixture = $this->prepareFixture($fileReferenceProperties, $originalFileProperties);
-               $fixture->getProperty(uniqid('nothingHere'));
+               $fixture->getProperty($this->getUniqueId('nothingHere'));
        }
 
        /**
index 695d742..99ec7f0 100644 (file)
@@ -61,7 +61,7 @@ class FileTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function commonPropertiesAreAvailableWithOwnGetters() {
                $properties = array(
-                       'name' => uniqid(),
+                       'name' => $this->getUniqueId(),
                        'storage' => $this->storageMock,
                        'size' => 1024
                );
@@ -85,7 +85,7 @@ class FileTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function updatePropertiesUpdatesFileProperties() {
-               $identifier = '/' . uniqid();
+               $identifier = '/' . $this->getUniqueId();
                $fixture = new \TYPO3\CMS\Core\Resource\File(array('uid' => 1, 'identifier' => '/test'), $this->storageMock);
                $fixture->updateProperties(array('identifier' => $identifier));
                $this->assertEquals($identifier, $fixture->getIdentifier());
index 9d44bdf..e9e3064 100644 (file)
@@ -51,8 +51,8 @@ class FolderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function constructorArgumentsAreAvailableAtRuntime() {
-               $path = uniqid();
-               $name = uniqid();
+               $path = $this->getUniqueId();
+               $name = $this->getUniqueId();
                $mockedStorage = $this->getMock(\TYPO3\CMS\Core\Resource\ResourceStorage::class, array(), array(), '', FALSE);
                $fixture = $this->createFolderFixture($path, $name, $mockedStorage);
                $this->assertSame($mockedStorage, $fixture->getStorage());
index f9774f3..5fbe75e 100644 (file)
@@ -43,7 +43,7 @@ class RendererRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function registeredFileRenderClassCanBeRetrieved() {
-               $rendererClass = uniqid('myRenderer');
+               $rendererClass = $this->getUniqueId('myRenderer');
                $rendererObject = $this->getMock(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class, array(), array(), $rendererClass);
 
                $rendererRegistry = $this->getTestRendererRegistry(array(array($rendererClass, $rendererObject)));
@@ -59,7 +59,7 @@ class RendererRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function registerRendererClassThrowsExceptionIfClassDoesNotExist() {
                $rendererRegistry = $this->getTestRendererRegistry();
-               $rendererRegistry->registerRendererClass(uniqid());
+               $rendererRegistry->registerRendererClass($this->getUniqueId());
        }
 
        /**
@@ -77,15 +77,15 @@ class RendererRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function registerRendererClassWithHighestPriorityIsFirstInResult() {
-               $rendererClass1 = uniqid('myRenderer1');
+               $rendererClass1 = $this->getUniqueId('myRenderer1');
                $rendererObject1 = $this->getMock(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class, array(), array(), $rendererClass1);
                $rendererObject1->expects($this->any())->method('getPriority')->will($this->returnValue(1));
 
-               $rendererClass2 = uniqid('myRenderer2');
+               $rendererClass2 = $this->getUniqueId('myRenderer2');
                $rendererObject2 = $this->getMock(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class, array(), array(), $rendererClass2);
                $rendererObject2->expects($this->any())->method('getPriority')->will($this->returnValue(10));
 
-               $rendererClass3 = uniqid('myRenderer3');
+               $rendererClass3 = $this->getUniqueId('myRenderer3');
                $rendererObject3 = $this->getMock(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class, array(), array(), $rendererClass3);
                $rendererObject3->expects($this->any())->method('getPriority')->will($this->returnValue(2));
 
@@ -110,11 +110,11 @@ class RendererRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function registeredFileRendererClassWithSamePriorityAreReturnedInSameOrderAsTheyWereAdded() {
-               $rendererClass1 = uniqid('myRenderer1');
+               $rendererClass1 = $this->getUniqueId('myRenderer1');
                $rendererObject1 = $this->getMock(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class, array(), array(), $rendererClass1);
                $rendererObject1->expects($this->any())->method('getPriority')->will($this->returnValue(1));
 
-               $rendererClass2 = uniqid('myRenderer2');
+               $rendererClass2 = $this->getUniqueId('myRenderer2');
                $rendererObject2 = $this->getMock(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class, array(), array(), $rendererClass2);
                $rendererObject2->expects($this->any())->method('getPriority')->will($this->returnValue(1));
 
@@ -139,12 +139,12 @@ class RendererRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
                $this->markTestSkipped('Test triggers a error this is known PHP bug - http://stackoverflow.com/questions/3235387/usort-array-was-modified-by-the-user-comparison-function)');
 
-               $rendererClass1 = uniqid('myVideoRenderer');
+               $rendererClass1 = $this->getUniqueId('myVideoRenderer');
                $rendererObject1 = $this->getMock(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class, array('getPriority', 'canRender', 'render'), array(), $rendererClass1);
                $rendererObject1->expects($this->any())->method('getPriority')->will($this->returnValue(1));
                $rendererObject1->expects($this->once())->method('canRender')->will($this->returnValue(TRUE));
 
-               $rendererClass2 = uniqid('myAudioRenderer');
+               $rendererClass2 = $this->getUniqueId('myAudioRenderer');
                $rendererObject2 = $this->getMock(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class, array('getPriority', 'canRender', 'render'), array(), $rendererClass2);
                $rendererObject2->expects($this->any())->method('getPriority')->will($this->returnValue(10));
                $rendererObject2->expects($this->once())->method('canRender')->will($this->returnValue(FALSE));
index 66a9ce3..82847e2 100644 (file)
@@ -57,8 +57,8 @@ class ResourceFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function createStorageCollectionObjectCreatesCollectionWithCorrectArguments() {
                $mockedMount = $this->getMock(\TYPO3\CMS\Core\Resource\ResourceStorage::class, array(), array(), '', FALSE);
-               $path = uniqid();
-               $name = uniqid();
+               $path = $this->getUniqueId();
+               $name = $this->getUniqueId();
                $storageCollection = $this->subject->createFolderObject($mockedMount, $path, $name, 0);
                $this->assertSame($mockedMount, $storageCollection->getStorage());
                $this->assertEquals($path . '/', $storageCollection->getIdentifier());
index 447e74e..77a339c 100644 (file)
@@ -222,9 +222,9 @@ class ResourceStorageTest extends BaseTestCase {
                $this->prepareSubject(array(), FALSE, $driverMock);
                $fileMock = $this->getSimpleFileMock($fileIdentifier);
                $this->subject->setEvaluatePermissions(TRUE);
-               $this->subject->addFileMount('/' . uniqid('random') . '/', array('read_only' => FALSE));
+               $this->subject->addFileMount('/' . $this->getUniqueId('random') . '/', array('read_only' => FALSE));
                $this->subject->addFileMount($fileMountFolderIdentifier, array('read_only' => $isFileMountReadOnly));
-               $this->subject->addFileMount('/' . uniqid('random') . '/', array('read_only' => FALSE));
+               $this->subject->addFileMount('/' . $this->getUniqueId('random') . '/', array('read_only' => FALSE));
                $this->assertSame($expectedResult, $this->subject->isWithinFileMountBoundaries($fileMock, $checkWriteAccess));
        }
 
@@ -519,7 +519,7 @@ class ResourceStorageTest extends BaseTestCase {
                $mockedFile->expects($this->any())->method('getUpdatedProperties')->will($this->returnValue(array_keys($newProperties)));
                // do not update directly; that's up to the indexer
                $indexFileRepositoryMock->expects($this->never())->method('update');
-               $this->subject->setFileContents($mockedFile, uniqid());
+               $this->subject->setFileContents($mockedFile, $this->getUniqueId());
        }
 
        /**
@@ -698,7 +698,7 @@ class ResourceStorageTest extends BaseTestCase {
                $this->setExpectedException('InvalidArgumentException', '', 1325842622);
                $this->prepareSubject(array(), TRUE);
                $mockedFile = $this->getSimpleFileMock('/someFile');
-               $this->subject->replaceFile($mockedFile, PATH_site . uniqid());
+               $this->subject->replaceFile($mockedFile, PATH_site . $this->getUniqueId());
        }
 
        /**
@@ -707,7 +707,7 @@ class ResourceStorageTest extends BaseTestCase {
         */
        public function getRoleReturnsDefaultForRegularFolders() {
                $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
-               $folderIdentifier = uniqid();
+               $folderIdentifier = $this->getUniqueId();
                $this->addToMount(array(
                        $folderIdentifier => array()
                ));
index 6be1d3d..26a57a6 100644 (file)
@@ -82,7 +82,7 @@ class TreeDataProviderFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function configuredDataProviderClassIsInstantiated() {
-               $dataProviderMockClassName = uniqid('tx_coretest_tree_data_provider');
+               $dataProviderMockClassName = $this->getUniqueId('tx_coretest_tree_data_provider');
                eval('class ' . $dataProviderMockClassName . ' {
                        function __construct($configuration) {
                        }
@@ -98,7 +98,7 @@ class TreeDataProviderFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function configuredDataProviderClassIsInstantiatedWithTcaConfigurationInConstructor() {
-               $dataProviderMockClassName = uniqid('tx_coretest_tree_data_provider');
+               $dataProviderMockClassName = $this->getUniqueId('tx_coretest_tree_data_provider');
                $tcaConfiguration = array('treeConfig' => array('dataProvider' => $dataProviderMockClassName), 'internal_type' => 'foo');
                $classCode = 'class ' . $dataProviderMockClassName . ' {
                        function __construct($configuration) {
index 4808482..db393ad 100644 (file)
@@ -194,7 +194,7 @@ class EnumerationTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @dataProvider isValidComparisonExpectations
         */
        public function isValidDoesTypeLooseComparison($enumerationValue, $testValue, $expectation) {
-               $mockName = uniqid('CompleteEnumerationMock');
+               $mockName = $this->getUniqueId('CompleteEnumerationMock');
                $enumeration = $this->getAccessibleMock(
                        \TYPO3\CMS\Core\Tests\Unit\Type\Fixture\Enumeration\CompleteEnumeration::class,
                        array('dummy'),
index 2219436..65d3818 100644 (file)
@@ -63,7 +63,7 @@ class TemplateServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function extensionStaticFilesAreNotProcessedIfNotExplicitlyRequested() {
-               $identifier = uniqid('test');
+               $identifier = $this->getUniqueId('test');
                $GLOBALS['TYPO3_LOADED_EXT'] = array(
                        $identifier => array(
                                'ext_typoscript_setup.txt' => ExtensionManagementUtility::extPath(
@@ -82,7 +82,7 @@ class TemplateServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function extensionStaticsAreProcessedIfExplicitlyRequested() {
-               $identifier = uniqid('test');
+               $identifier = $this->getUniqueId('test');
                $GLOBALS['TYPO3_LOADED_EXT'] = array(
                        $identifier => array(
                                'ext_typoscript_setup.txt' => ExtensionManagementUtility::extPath(
index 175a304..2ad82f5 100644 (file)
@@ -203,7 +203,7 @@ class ArrayUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isValidPathReturnsTrueIfPathExists() {
-               $className = uniqid('ArrayUtility');
+               $className = $this->getUniqueId('ArrayUtility');
                eval(
                        'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ArrayUtility {' .
@@ -220,7 +220,7 @@ class ArrayUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isValidPathReturnsFalseIfPathDoesNotExist() {
-               $className = uniqid('ArrayUtility');
+               $className = $this->getUniqueId('ArrayUtility');
                eval(
                        'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ArrayUtility {' .
index 5c491f7..ec5a8a3 100644 (file)
@@ -163,7 +163,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function isLoadedReturnsFalseIfExtensionIsNotLoadedAndExitIsDisabled() {
-               $this->assertFalse(ExtensionManagementUtility::isLoaded(uniqid('foobar'), FALSE));
+               $this->assertFalse(ExtensionManagementUtility::isLoaded($this->getUniqueId('foobar'), FALSE));
        }
 
        /**
@@ -171,7 +171,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @expectedException \BadFunctionCallException
         */
        public function isLoadedThrowsExceptionIfExtensionIsNotLoaded() {
-               $this->assertFalse(ExtensionManagementUtility::isLoaded(uniqid('foobar'), TRUE));
+               $this->assertFalse(ExtensionManagementUtility::isLoaded($this->getUniqueId('foobar'), TRUE));
        }
 
        ///////////////////////////////
@@ -182,7 +182,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @expectedException \BadFunctionCallException
         */
        public function extPathThrowsExceptionIfExtensionIsNotLoaded() {
-               $packageName = uniqid('foo');
+               $packageName = $this->getUniqueId('foo');
                $packageManager = $this->getMock(\TYPO3\CMS\Core\Package\PackageManager::class, array('isPackageActive'));
                $packageManager->expects($this->once())
                                ->method('isPackageActive')
@@ -291,7 +291,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function getExtensionKeyByPrefixForLoadedExtensionWithUnderscoresReturnsExtensionKey() {
                ExtensionManagementUtility::clearExtensionKeyMap();
-               $uniqueSuffix = uniqid('test');
+               $uniqueSuffix = $this->getUniqueId('test');
                $extensionKey = 'tt_news' . $uniqueSuffix;
                $extensionPrefix = 'tx_ttnews' . $uniqueSuffix;
                $package = $this->getMockBuilder(\TYPO3\CMS\Core\Package\Package::class)
@@ -315,7 +315,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function getExtensionKeyByPrefixForLoadedExtensionWithoutUnderscoresReturnsExtensionKey() {
                ExtensionManagementUtility::clearExtensionKeyMap();
-               $uniqueSuffix = uniqid('test');
+               $uniqueSuffix = $this->getUniqueId('test');
                $extensionKey = 'kickstarter' . $uniqueSuffix;
                $extensionPrefix = 'tx_kickstarter' . $uniqueSuffix;
                $package = $this->getMockBuilder(\TYPO3\CMS\Core\Package\Package::class)
@@ -339,7 +339,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function getExtensionKeyByPrefixForNotLoadedExtensionReturnsFalse() {
                ExtensionManagementUtility::clearExtensionKeyMap();
-               $uniqueSuffix = uniqid('test');
+               $uniqueSuffix = $this->getUniqueId('test');
                $extensionKey = 'unloadedextension' . $uniqueSuffix;
                $extensionPrefix = 'tx_unloadedextension' . $uniqueSuffix;
                $this->assertFalse(ExtensionManagementUtility::getExtensionKeyByPrefix($extensionPrefix));
@@ -355,7 +355,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addToAllTCAtypes()
         */
        public function canAddFieldsToAllTCATypesBeforeExistingOnes() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
                ExtensionManagementUtility::addToAllTCAtypes($table, 'newA, newA, newB, fieldA', '', 'before:fieldD');
                // Checking typeA:
@@ -371,7 +371,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addToAllTCAtypes()
         */
        public function canAddFieldsToAllTCATypesAfterExistingOnes() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
                ExtensionManagementUtility::addToAllTCAtypes($table, 'newA, newA, newB, fieldA', '', 'after:fieldC');
                // Checking typeA:
@@ -387,7 +387,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addToAllTCAtypes()
         */
        public function canAddFieldsToTCATypeBeforeExistingOnes() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
                ExtensionManagementUtility::addToAllTCAtypes($table, 'newA, newA, newB, fieldA', 'typeA', 'before:fieldD');
                // Checking typeA:
@@ -403,7 +403,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addToAllTCAtypes()
         */
        public function canAddFieldsToTCATypeAfterExistingOnes() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
                ExtensionManagementUtility::addToAllTCAtypes($table, 'newA, newA, newB, fieldA', 'typeA', 'after:fieldC');
                // Checking typeA:
@@ -419,7 +419,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addFieldsToAllPalettesOfField()
         */
        public function canAddFieldsToTCATypeAndReplaceExistingOnes() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
                $typesBefore = $GLOBALS['TCA'][$table]['types'];
                ExtensionManagementUtility::addToAllTCAtypes($table, 'fieldZ', '', 'replace:fieldX');
@@ -442,7 +442,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addFieldsToPalette()
         */
        public function canAddFieldsToPaletteBeforeExistingOnes() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
                ExtensionManagementUtility::addFieldsToPalette($table, 'paletteA', 'newA, newA, newB, fieldX', 'before:fieldY');
                $this->assertEquals('fieldX, fieldX1, newA, newB, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteA']['showitem']);
@@ -455,7 +455,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addFieldsToPalette()
         */
        public function canAddFieldsToPaletteAfterExistingOnes() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
                ExtensionManagementUtility::addFieldsToPalette($table, 'paletteA', 'newA, newA, newB, fieldX', 'after:fieldX');
                $this->assertEquals('fieldX, newA, newB, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteA']['showitem']);
@@ -468,9 +468,9 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addFieldsToPalette()
         */
        public function canAddFieldsToPaletteAfterNotExistingOnes() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
-               ExtensionManagementUtility::addFieldsToPalette($table, 'paletteA', 'newA, newA, newB, fieldX', 'after:' . uniqid('notExisting'));
+               ExtensionManagementUtility::addFieldsToPalette($table, 'paletteA', 'newA, newA, newB, fieldX', 'after:' . $this->getUniqueId('notExisting'));
                $this->assertEquals('fieldX, fieldX1, fieldY, newA, newB', $GLOBALS['TCA'][$table]['palettes']['paletteA']['showitem']);
        }
 
@@ -516,7 +516,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addFieldsToAllPalettesOfField()
         */
        public function canAddFieldsToAllPalettesOfFieldBeforeExistingOnes() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
                ExtensionManagementUtility::addFieldsToAllPalettesOfField($table, 'fieldC', 'newA, newA, newB, fieldX', 'before:fieldY');
                $this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteA']['showitem']);
@@ -532,7 +532,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addFieldsToAllPalettesOfField()
         */
        public function canAddFieldsToAllPalettesOfFieldAfterExistingOnes() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
                ExtensionManagementUtility::addFieldsToAllPalettesOfField($table, 'fieldC', 'newA, newA, newB, fieldX', 'after:fieldX');
                $this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteA']['showitem']);
@@ -548,9 +548,9 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addFieldsToAllPalettesOfField()
         */
        public function canAddFieldsToAllPalettesOfFieldAfterNotExistingOnes() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
-               ExtensionManagementUtility::addFieldsToAllPalettesOfField($table, 'fieldC', 'newA, newA, newB, fieldX', 'after:' . uniqid('notExisting'));
+               ExtensionManagementUtility::addFieldsToAllPalettesOfField($table, 'fieldC', 'newA, newA, newB, fieldX', 'after:' . $this->getUniqueId('notExisting'));
                $this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteA']['showitem']);
                $this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteB']['showitem']);
                $this->assertEquals('fieldX, fieldX1, fieldY, newA, newB', $GLOBALS['TCA'][$table]['palettes']['paletteC']['showitem']);
@@ -564,7 +564,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @see ExtensionManagementUtility::addFieldsToAllPalettesOfField()
         */
        public function canAddFieldsToAllPalettesOfFieldWithoutPaletteExistingBefore() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'] = $this->generateTCAForTable($table);
                ExtensionManagementUtility::addFieldsToAllPalettesOfField($table, 'fieldA', 'newA, newA, newB, fieldX');
                $this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteA']['showitem']);
@@ -764,7 +764,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $mockCacheManager = $this->getMock(\TYPO3\CMS\Core\Cache\CacheManager::class, array('getCache'));
                $mockCacheManager->expects($this->never())->method('getCache');
                ExtensionManagementUtilityAccessibleProxy::setCacheManager($mockCacheManager);
-               $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($this->createMockPackageManagerWithMockPackage(uniqid()));
+               $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($this->createMockPackageManagerWithMockPackage($this->getUniqueId()));
                ExtensionManagementUtility::loadExtLocalconf(FALSE);
        }
 
@@ -795,7 +795,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @expectedException \RuntimeException
         */
        public function loadSingleExtLocalconfFilesRequiresExtLocalconfFileRegisteredInGlobalTypo3LoadedExt() {
-               $extensionName = uniqid('foo');
+               $extensionName = $this->getUniqueId('foo');
                $packageManager = $this->createMockPackageManagerWithMockPackage($extensionName);
                $extLocalconfLocation = $packageManager->getPackage($extensionName)->getPackagePath() . 'ext_localconf.php';
                file_put_contents($extLocalconfLocation, "<?php\n\nthrow new RuntimeException('', 1340559079);\n\n?>");
@@ -881,10 +881,10 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function createExtLocalconfCacheEntryWritesCacheEntryWithContentOfLoadedExtensionExtLocalconf() {
-               $extensionName = uniqid('foo');
+               $extensionName = $this->getUniqueId('foo');
                $packageManager = $this->createMockPackageManagerWithMockPackage($extensionName);
                $extLocalconfLocation = $packageManager->getPackage($extensionName)->getPackagePath() . 'ext_localconf.php';
-               $uniqueStringInLocalconf = uniqid('foo');
+               $uniqueStringInLocalconf = $this->getUniqueId('foo');
                file_put_contents($extLocalconfLocation, "<?php\n\n" . $uniqueStringInLocalconf . "\n\n?>");
                $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($packageManager);
                $mockCache = $this->getMock(
@@ -905,7 +905,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function createExtLocalconfCacheEntryWritesCacheEntryWithExtensionContentOnlyIfExtLocalconfExists() {
-               $extensionName = uniqid('foo');
+               $extensionName = $this->getUniqueId('foo');
                $packageManager = $this->createMockPackageManagerWithMockPackage($extensionName);
                $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($packageManager);
                $mockCache = $this->getMock(
@@ -939,7 +939,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $mockCacheManager->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
                ExtensionManagementUtilityAccessibleProxy::setCacheManager($mockCacheManager);
                $mockCache->expects($this->once())->method('set')->with($this->anything(), $this->anything(), $this->equalTo(array()));
-               $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($this->createMockPackageManagerWithMockPackage(uniqid()));
+               $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($this->createMockPackageManagerWithMockPackage($this->getUniqueId()));
                ExtensionManagementUtilityAccessibleProxy::createExtLocalconfCacheEntry();
        }
 
@@ -994,7 +994,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function loadBaseTcaCreatesCacheFileWithContentOfAnExtensionsConfigurationTcaPhpFile() {
-               $extensionName = uniqid('test_baseTca_');
+               $extensionName = $this->getUniqueId('test_baseTca_');
                $packageManager = $this->createMockPackageManagerWithMockPackage($extensionName);
                $packagePath = $packageManager->getPackage($extensionName)->getPackagePath();
                GeneralUtility::mkdir($packagePath);
@@ -1002,8 +1002,8 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                GeneralUtility::mkdir($packagePath . 'Configuration/TCA/');
                $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($packageManager);
                ExtensionManagementUtility::setPackageManager($packageManager);
-               $uniqueTableName = uniqid('table_name_');
-               $uniqueStringInTableConfiguration = uniqid('table_configuration_');
+               $uniqueTableName = $this->getUniqueId('table_name_');
+               $uniqueStringInTableConfiguration = $this->getUniqueId('table_configuration_');
                $tableConfiguration = '<?php return array(\'foo\' => \'' . $uniqueStringInTableConfiguration . '\'); ?>';
                file_put_contents($packagePath . 'Configuration/TCA/' . $uniqueTableName . '.php', $tableConfiguration);
                $mockCache = $this->getMock(
@@ -1065,7 +1065,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $mockCacheManager = $this->getMock(\TYPO3\CMS\Core\Cache\CacheManager::class, array('getCache'));
                $mockCacheManager->expects($this->never())->method('getCache');
                ExtensionManagementUtilityAccessibleProxy::setCacheManager($mockCacheManager);
-               $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($this->createMockPackageManagerWithMockPackage(uniqid()));
+               $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($this->createMockPackageManagerWithMockPackage($this->getUniqueId()));
                ExtensionManagementUtility::loadExtLocalconf(FALSE);
        }
 
@@ -1098,10 +1098,10 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function createExtTablesCacheEntryWritesCacheEntryWithContentOfLoadedExtensionExtTables() {
-               $extensionName = uniqid('foo');
-               $extTablesLocation = PATH_site . 'typo3temp/' . uniqid('test_ext_tables') . '.php';
+               $extensionName = $this->getUniqueId('foo');
+               $extTablesLocation = PATH_site . 'typo3temp/' . $this->getUniqueId('test_ext_tables') . '.php';
                $this->testFilesToDelete[] = $extTablesLocation;
-               $uniqueStringInTables = uniqid('foo');
+               $uniqueStringInTables = $this->getUniqueId('foo');
                file_put_contents($extTablesLocation, "<?php\n\n$uniqueStringInTables\n\n?>");
                $GLOBALS['TYPO3_LOADED_EXT'] = array(
                        $extensionName => array(
@@ -1126,7 +1126,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function createExtTablesCacheEntryWritesCacheEntryWithExtensionContentOnlyIfExtTablesExists() {
-               $extensionName = uniqid('foo');
+               $extensionName = $this->getUniqueId('foo');
                $GLOBALS['TYPO3_LOADED_EXT'] = array(
                        $extensionName => array(),
                );
@@ -1161,7 +1161,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $mockCacheManager->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
                ExtensionManagementUtilityAccessibleProxy::setCacheManager($mockCacheManager);
                $mockCache->expects($this->once())->method('set')->with($this->anything(), $this->anything(), $this->equalTo(array()));
-               $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($this->createMockPackageManagerWithMockPackage(uniqid()));
+               $GLOBALS['TYPO3_LOADED_EXT'] = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($this->createMockPackageManagerWithMockPackage($this->getUniqueId()));
                ExtensionManagementUtilityAccessibleProxy::createExtTablesCacheEntry();
        }
 
@@ -1259,7 +1259,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function getExtensionVersionForNotLoadedExtensionReturnsEmptyString() {
                ExtensionManagementUtility::clearExtensionKeyMap();
-               $uniqueSuffix = uniqid('test');
+               $uniqueSuffix = $this->getUniqueId('test');
                $extensionKey = 'unloadedextension' . $uniqueSuffix;
                $this->assertEquals('', ExtensionManagementUtility::getExtensionVersion($extensionKey));
        }
@@ -1269,7 +1269,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function getExtensionVersionForLoadedExtensionReturnsExtensionVersion() {
                ExtensionManagementUtility::clearExtensionKeyMap();
-               $className = uniqid('ExtensionManagementUtility');
+               $className = $this->getUniqueId('ExtensionManagementUtility');
                eval(
                        'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility {' .
@@ -1280,7 +1280,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                );
                $className = __NAMESPACE__ . '\\' . $className;
                ExtensionManagementUtility::clearExtensionKeyMap();
-               $uniqueSuffix = uniqid('test');
+               $uniqueSuffix = $this->getUniqueId('test');
                $extensionKey = 'unloadedextension' . $uniqueSuffix;
                $packageMetaData = $this->getMock(\TYPO3\Flow\Package\MetaData::class, array('getVersion'), array($extensionKey));
                $packageMetaData->expects($this->any())->method('getVersion')->will($this->returnValue('1.2.3'));
@@ -1302,7 +1302,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @expectedException \RuntimeException
         */
        public function loadExtensionThrowsExceptionIfExtensionIsLoaded() {
-               $extensionKey = uniqid('test');
+               $extensionKey = $this->getUniqueId('test');
                $packageManager = $this->createMockPackageManagerWithMockPackage($extensionKey);
                ExtensionManagementUtility::setPackageManager($packageManager);
                ExtensionManagementUtility::loadExtension($extensionKey);
@@ -1316,7 +1316,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @expectedException \RuntimeException
         */
        public function unloadExtensionThrowsExceptionIfExtensionIsNotLoaded() {
-               $packageName = uniqid('foo');
+               $packageName = $this->getUniqueId('foo');
                $packageManager = $this->getMock(\TYPO3\CMS\Core\Package\PackageManager::class, array('isPackageActive'));
                $packageManager->expects($this->once())
                        ->method('isPackageActive')
@@ -1330,7 +1330,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function unloadExtensionCallsPackageManagerToDeactivatePackage() {
-               $packageName = uniqid('foo');
+               $packageName = $this->getUniqueId('foo');
                $packageManager = $this->getMock(
                        \TYPO3\CMS\Core\Package\PackageManager::class,
                        array('isPackageActive', 'deactivatePackage')
@@ -1352,8 +1352,8 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function doesMakeCategorizableCallsTheCategoryRegistryWithDefaultFieldName() {
-               $extensionKey = uniqid('extension');
-               $tableName = uniqid('table');
+               $extensionKey = $this->getUniqueId('extension');
+               $tableName = $this->getUniqueId('table');
 
                $registryMock = $this->getMock(\TYPO3\CMS\Core\Category\CategoryRegistry::class);
                $registryMock->expects($this->once())->method('add')->with($extensionKey, $tableName, 'categories', array());
@@ -1365,9 +1365,9 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function doesMakeCategorizableCallsTheCategoryRegistryWithFieldName() {
-               $extensionKey = uniqid('extension');
-               $tableName = uniqid('table');
-               $fieldName = uniqid('field');
+               $extensionKey = $this->getUniqueId('extension');
+               $tableName = $this->getUniqueId('table');
+               $fieldName = $this->getUniqueId('field');
 
                $registryMock = $this->getMock(\TYPO3\CMS\Core\Category\CategoryRegistry::class);
                $registryMock->expects($this->once())->method('add')->with($extensionKey, $tableName, $fieldName, array());
index 21959cf..84569df 100644 (file)
@@ -2063,7 +2063,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function unlink_tempfileRemovesValidFileInTypo3temp() {
                $fixtureFile = __DIR__ . '/Fixtures/clear.gif';
-               $testFilename = PATH_site . 'typo3temp/' . uniqid('test_') . '.gif';
+               $testFilename = PATH_site . 'typo3temp/' . $this->getUniqueId('test_') . '.gif';
                @copy($fixtureFile, $testFilename);
                Utility\GeneralUtility::unlink_tempfile($testFilename);
                $fileExists = file_exists($testFilename);
@@ -2075,7 +2075,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function unlink_tempfileRemovesHiddenFile() {
                $fixtureFile = __DIR__ . '/Fixtures/clear.gif';
-               $testFilename = PATH_site . 'typo3temp/' . uniqid('.test_') . '.gif';
+               $testFilename = PATH_site . 'typo3temp/' . $this->getUniqueId('.test_') . '.gif';
                @copy($fixtureFile, $testFilename);
                Utility\GeneralUtility::unlink_tempfile($testFilename);
                $fileExists = file_exists($testFilename);
@@ -2087,7 +2087,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function unlink_tempfileReturnsTrueIfFileWasRemoved() {
                $fixtureFile = __DIR__ . '/Fixtures/clear.gif';
-               $testFilename = PATH_site . 'typo3temp/' . uniqid('test_') . '.gif';
+               $testFilename = PATH_site . 'typo3temp/' . $this->getUniqueId('test_') . '.gif';
                @copy($fixtureFile, $testFilename);
                $returnValue = Utility\GeneralUtility::unlink_tempfile($testFilename);
                $this->assertTrue($returnValue);
@@ -2097,7 +2097,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function unlink_tempfileReturnsNullIfFileDoesNotExist() {
-               $returnValue = Utility\GeneralUtility::unlink_tempfile(PATH_site . 'typo3temp/' . uniqid('i_do_not_exist'));
+               $returnValue = Utility\GeneralUtility::unlink_tempfile(PATH_site . 'typo3temp/' . $this->getUniqueId('i_do_not_exist'));
                $this->assertNull($returnValue);
        }
 
@@ -2554,7 +2554,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function readLLfileHandlesLocallangXMLOverride() {
-               $unique = uniqid('locallangXMLOverrideTest');
+               $unique = 'locallangXMLOverrideTest' . substr($this->getUniqueId(), 0, 10);
                $xml = '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
                        <T3locallang>
                                <data type="array">
@@ -2684,7 +2684,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function minifyJavaScriptReturnsInputStringIfNoHookIsRegistered() {
                unset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['minifyJavaScript']);
-               $testString = uniqid('string');
+               $testString = $this->getUniqueId('string');
                $this->assertSame($testString, Utility\GeneralUtility::minifyJavaScript($testString));
        }
 
@@ -2695,7 +2695,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function minifyJavaScriptCallsRegisteredHookWithInputString() {
-               $hookClassName = uniqid('tx_coretest');
+               $hookClassName = $this->getUniqueId('tx_coretest');
                $minifyHookMock = $this->getMock('stdClass', array('minify'), array(), $hookClassName);
                $functionName = '&' . $hookClassName . '->minify';
                $GLOBALS['T3_VAR']['callUserFunction'][$functionName] = array();
@@ -2727,7 +2727,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function minifyJavaScriptReturnsErrorStringOfHookException() {
-               $hookClassName = uniqid('tx_coretest');
+               $hookClassName = $this->getUniqueId('tx_coretest');
                $minifyHookMock = $this->getMock('stdClass', array('minify'), array(), $hookClassName);
                $functionName = '&' . $hookClassName . '->minify';
                $GLOBALS['T3_VAR']['callUserFunction'][$functionName] = array();
@@ -2747,10 +2747,10 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function minifyJavaScriptWritesExceptionMessageToDevLog() {
-               $t3libDivMock = uniqid('GeneralUtility');
+               $t3libDivMock = $this->getUniqueId('GeneralUtility');
                eval('namespace ' . __NAMESPACE__ . '; class ' . $t3libDivMock . ' extends \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility {' . '  public static function devLog($errorMessage) {' . '    if (!($errorMessage === \'Error minifying java script: foo\')) {' . '      throw new \\UnexpectedValue(\'broken\');' . '    }' . '    throw new \\RuntimeException();' . '  }' . '}');
                $t3libDivMock = __NAMESPACE__ . '\\' . $t3libDivMock;
-               $hookClassName = uniqid('tx_coretest');
+               $hookClassName = $this->getUniqueId('tx_coretest');
                $minifyHookMock = $this->getMock('stdClass', array('minify'), array(), $hookClassName);
                $functionName = '&' . $hookClassName . '->minify';
                $GLOBALS['T3_VAR']['callUserFunction'][$functionName] = array();
@@ -2790,7 +2790,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('The fixPermissionsSetsGroup() is not available on Mac OS because posix_getegid() always returns -1 on Mac OS.');
                }
                // Create and prepare test file
-               $filename = PATH_site . 'typo3temp/' . uniqid('test_');
+               $filename = PATH_site . 'typo3temp/' . $this->getUniqueId('test_');
                Utility\GeneralUtility::writeFileToTypo3tempDir($filename, '42');
                $this->testFilesToDelete[] = $filename;
                $currentGroupId = posix_getegid();
@@ -2809,7 +2809,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('fixPermissions() tests not available on Windows');
                }
                // Create and prepare test file
-               $filename = PATH_site . 'typo3temp/' . uniqid('test_');
+               $filename = PATH_site . 'typo3temp/' . $this->getUniqueId('test_');
                Utility\GeneralUtility::writeFileToTypo3tempDir($filename, '42');
                $this->testFilesToDelete[] = $filename;
                chmod($filename, 482);
@@ -2829,7 +2829,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('fixPermissions() tests not available on Windows');
                }
                // Create and prepare test file
-               $filename = PATH_site . 'typo3temp/' . uniqid('.test_');
+               $filename = PATH_site . 'typo3temp/' . $this->getUniqueId('.test_');
                Utility\GeneralUtility::writeFileToTypo3tempDir($filename, '42');
                $this->testFilesToDelete[] = $filename;
                chmod($filename, 482);
@@ -2849,7 +2849,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('fixPermissions() tests not available on Windows');
                }
                // Create and prepare test directory
-               $directory = PATH_site . 'typo3temp/' . uniqid('test_');
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('test_');
                Utility\GeneralUtility::mkdir($directory);
                $this->testFilesToDelete[] = $directory;
                chmod($directory, 1551);
@@ -2869,7 +2869,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('fixPermissions() tests not available on Windows');
                }
                // Create and prepare test directory
-               $directory = PATH_site . 'typo3temp/' . uniqid('test_');
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('test_');
                Utility\GeneralUtility::mkdir($directory);
                $this->testFilesToDelete[] = $directory;
                chmod($directory, 1551);
@@ -2890,7 +2890,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('fixPermissions() tests not available on Windows');
                }
                // Create and prepare test directory
-               $directory = PATH_site . 'typo3temp/' . uniqid('.test_');
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('.test_');
                Utility\GeneralUtility::mkdir($directory);
                $this->testFilesToDelete[] = $directory;
                chmod($directory, 1551);
@@ -2911,7 +2911,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('fixPermissions() tests not available on Windows');
                }
                // Create and prepare test directory and file structure
-               $baseDirectory = PATH_site . 'typo3temp/' . uniqid('test_');
+               $baseDirectory = PATH_site . 'typo3temp/' . $this->getUniqueId('test_');
                Utility\GeneralUtility::mkdir($baseDirectory);
                $this->testFilesToDelete[] = $baseDirectory;
                chmod($baseDirectory, 1751);
@@ -2962,7 +2962,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('fixPermissions() tests not available on Windows');
                }
                // Create and prepare test file
-               $filename = PATH_site . 'typo3temp/../typo3temp/' . uniqid('test_');
+               $filename = PATH_site . 'typo3temp/../typo3temp/' . $this->getUniqueId('test_');
                touch($filename);
                chmod($filename, 482);
                // Set target permissions and run method
@@ -2980,7 +2980,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                if (TYPO3_OS == 'WIN') {
                        $this->markTestSkipped('fixPermissions() tests not available on Windows');
                }
-               $filename = 'typo3temp/' . uniqid('test_');
+               $filename = 'typo3temp/' . $this->getUniqueId('test_');
                Utility\GeneralUtility::writeFileToTypo3tempDir(PATH_site . $filename, '42');
                $this->testFilesToDelete[] = PATH_site . $filename;
                chmod(PATH_site . $filename, 482);
@@ -2999,7 +2999,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                if (TYPO3_OS == 'WIN') {
                        $this->markTestSkipped('fixPermissions() tests not available on Windows');
                }
-               $filename = PATH_site . 'typo3temp/' . uniqid('test_');
+               $filename = PATH_site . 'typo3temp/' . $this->getUniqueId('test_');
                Utility\GeneralUtility::writeFileToTypo3tempDir($filename, '42');
                $this->testFilesToDelete[] = $filename;
                chmod($filename, 482);
@@ -3017,7 +3017,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                if (TYPO3_OS == 'WIN') {
                        $this->markTestSkipped('fixPermissions() tests not available on Windows');
                }
-               $directory = PATH_site . 'typo3temp/' . uniqid('test_');
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('test_');
                Utility\GeneralUtility::mkdir($directory);
                $this->testFilesToDelete[] = $directory;
                chmod($directory, 1551);
@@ -3035,7 +3035,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function mkdirCreatesDirectory() {
-               $directory = PATH_site . 'typo3temp/' . uniqid('test_');
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('test_');
                $mkdirResult = Utility\GeneralUtility::mkdir($directory);
                $this->testFilesToDelete[] = $directory;
                clearstatcache();
@@ -3047,7 +3047,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function mkdirCreatesHiddenDirectory() {
-               $directory = PATH_site . 'typo3temp/' . uniqid('.test_');
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('.test_');
                $mkdirResult = Utility\GeneralUtility::mkdir($directory);
                $this->testFilesToDelete[] = $directory;
                clearstatcache();
@@ -3059,7 +3059,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function mkdirCreatesDirectoryWithTrailingSlash() {
-               $directory = PATH_site . 'typo3temp/' . uniqid('test_') . '/';
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('test_') . '/';
                $mkdirResult = Utility\GeneralUtility::mkdir($directory);
                $this->testFilesToDelete[] = $directory;
                clearstatcache();
@@ -3074,7 +3074,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                if (TYPO3_OS == 'WIN') {
                        $this->markTestSkipped('mkdirSetsPermissionsOfCreatedDirectory() test not available on Windows');
                }
-               $directory = PATH_site . 'typo3temp/' . uniqid('test_');
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('test_');
                $oldUmask = umask(19);
                $GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask'] = '0772';
                Utility\GeneralUtility::mkdir($directory);
@@ -3098,7 +3098,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $swapGroup = $this->checkGroups(__FUNCTION__);
                if ($swapGroup !== FALSE) {
                        $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup'] = $swapGroup;
-                       $directory = uniqid('mkdirtest_');
+                       $directory = $this->getUniqueId('mkdirtest_');
                        Utility\GeneralUtility::mkdir(PATH_site . 'typo3temp/' . $directory);
                        $this->testFilesToDelete[] = PATH_site . 'typo3temp/' . $directory;
                        clearstatcache();
@@ -3148,7 +3148,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function mkdirDeepCreatesDirectory() {
-               $directory = 'typo3temp/' . uniqid('test_');
+               $directory = 'typo3temp/' . $this->getUniqueId('test_');
                Utility\GeneralUtility::mkdir_deep(PATH_site, $directory);
                $this->testFilesToDelete[] = PATH_site . $directory;
                $this->assertTrue(is_dir(PATH_site . $directory));
@@ -3158,7 +3158,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function mkdirDeepCreatesSubdirectoriesRecursive() {
-               $directory = 'typo3temp/' . uniqid('test_');
+               $directory = 'typo3temp/' . $this->getUniqueId('test_');
                $subDirectory = $directory . '/foo';
                Utility\GeneralUtility::mkdir_deep(PATH_site, $subDirectory);
                $this->testFilesToDelete[] = PATH_site . $directory;
@@ -3172,7 +3172,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                if (TYPO3_OS == 'WIN') {
                        $this->markTestSkipped('mkdirDeepFixesPermissionsOfCreatedDirectory() test not available on Windows.');
                }
-               $directory = uniqid('mkdirdeeptest_');
+               $directory = $this->getUniqueId('mkdirdeeptest_');
                $oldUmask = umask(19);
                $GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask'] = '0777';
                Utility\GeneralUtility::mkdir_deep(PATH_site . 'typo3temp/', $directory);
@@ -3189,7 +3189,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                if (TYPO3_OS == 'WIN') {
                        $this->markTestSkipped('mkdirDeepFixesPermissionsOnNewParentDirectory() test not available on Windows.');
                }
-               $directory = uniqid('mkdirdeeptest_');
+               $directory = $this->getUniqueId('mkdirdeeptest_');
                $subDirectory = $directory . '/bar';
                $GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask'] = '0777';
                $oldUmask = umask(19);
@@ -3208,8 +3208,8 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('mkdirDeepDoesNotChangePermissionsOfExistingSubDirectories() test not available on Windows.');
                }
                $baseDirectory = PATH_site . 'typo3temp/';
-               $existingDirectory = uniqid('test_existing_') . '/';
-               $newSubDirectory = uniqid('test_new_');
+               $existingDirectory = $this->getUniqueId('test_existing_') . '/';
+               $newSubDirectory = $this->getUniqueId('test_new_');
                @mkdir(($baseDirectory . $existingDirectory));
                $this->testFilesToDelete[] = $baseDirectory . $existingDirectory;
                chmod($baseDirectory . $existingDirectory, 482);
@@ -3224,7 +3224,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $swapGroup = $this->checkGroups(__FUNCTION__);
                if ($swapGroup !== FALSE) {
                        $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup'] = $swapGroup;
-                       $directory = uniqid('mkdirdeeptest_');
+                       $directory = $this->getUniqueId('mkdirdeeptest_');
                        Utility\GeneralUtility::mkdir_deep(PATH_site . 'typo3temp/', $directory);
                        $this->testFilesToDelete[] = PATH_site . 'typo3temp/' . $directory;
                        clearstatcache();
@@ -3241,7 +3241,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $swapGroup = $this->checkGroups(__FUNCTION__);
                if ($swapGroup !== FALSE) {
                        $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup'] = $swapGroup;
-                       $directory = uniqid('mkdirdeeptest_');
+                       $directory = $this->getUniqueId('mkdirdeeptest_');
                        $subDirectory = $directory . '/bar';
                        Utility\GeneralUtility::mkdir_deep(PATH_site . 'typo3temp/', $subDirectory);
                        $this->testFilesToDelete[] = PATH_site . 'typo3temp/' . $directory;
@@ -3259,7 +3259,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $swapGroup = $this->checkGroups(__FUNCTION__);
                if ($swapGroup !== FALSE) {
                        $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup'] = $swapGroup;
-                       $directory = uniqid('mkdirdeeptest_');
+                       $directory = $this->getUniqueId('mkdirdeeptest_');
                        $subDirectory = $directory . '/bar';
                        Utility\GeneralUtility::mkdir_deep(PATH_site . 'typo3temp/', $subDirectory);
                        $this->testFilesToDelete[] = PATH_site . 'typo3temp/' . $directory;
@@ -3278,7 +3278,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('mkdirDeepCreatesDirectoryInVfsStream() test not available with this phpunit version.');
                }
                vfsStreamWrapper::register();
-               $baseDirectory = uniqid('test_');
+               $baseDirectory = $this->getUniqueId('test_');
                vfsStreamWrapper::setRoot(new vfsStreamDirectory($baseDirectory));
                Utility\GeneralUtility::mkdir_deep('vfs://' . $baseDirectory . '/', 'sub');
                $this->assertTrue(is_dir('vfs://' . $baseDirectory . '/sub'));
@@ -3316,7 +3316,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function rmdirRemovesFile() {
-               $file = PATH_site . 'typo3temp/' . uniqid('file_');
+               $file = PATH_site . 'typo3temp/' . $this->getUniqueId('file_');
                touch($file);
                Utility\GeneralUtility::rmdir($file);
                $this->assertFalse(file_exists($file));
@@ -3326,7 +3326,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function rmdirReturnTrueIfFileWasRemoved() {
-               $file = PATH_site . 'typo3temp/' . uniqid('file_');
+               $file = PATH_site . 'typo3temp/' . $this->getUniqueId('file_');
                touch($file);
                $this->assertTrue(Utility\GeneralUtility::rmdir($file));
        }
@@ -3335,7 +3335,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function rmdirReturnFalseIfNoFileWasRemoved() {
-               $file = PATH_site . 'typo3temp/' . uniqid('file_');
+               $file = PATH_site . 'typo3temp/' . $this->getUniqueId('file_');
                $this->assertFalse(Utility\GeneralUtility::rmdir($file));
        }
 
@@ -3343,7 +3343,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function rmdirRemovesDirectory() {
-               $directory = PATH_site . 'typo3temp/' . uniqid('directory_');
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('directory_');
                mkdir($directory);
                Utility\GeneralUtility::rmdir($directory);
                $this->assertFalse(file_exists($directory));
@@ -3353,7 +3353,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function rmdirRemovesDirectoryWithTrailingSlash() {
-               $directory = PATH_site . 'typo3temp/' . uniqid('directory_') . '/';
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('directory_') . '/';
                mkdir($directory);
                Utility\GeneralUtility::rmdir($directory);
                $this->assertFalse(file_exists($directory));
@@ -3363,9 +3363,9 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function rmdirDoesNotRemoveDirectoryWithFilesAndReturnsFalseIfRecursiveDeletionIsOff() {
-               $directory = PATH_site . 'typo3temp/' . uniqid('directory_') . '/';
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('directory_') . '/';
                mkdir($directory);
-               $file = uniqid('file_');
+               $file = $this->getUniqueId('file_');
                touch($directory . $file);
                $this->testFilesToDelete[] = $directory;
                $return = Utility\GeneralUtility::rmdir($directory);
@@ -3378,7 +3378,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function rmdirRemovesDirectoriesRecursiveAndReturnsTrue() {
-               $directory = PATH_site . 'typo3temp/' . uniqid('directory_') . '/';
+               $directory = PATH_site . 'typo3temp/' . $this->getUniqueId('directory_') . '/';
                mkdir($directory);
                mkdir($directory . 'sub/');
                touch($directory . 'sub/file');
@@ -3394,10 +3394,10 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                if (TYPO3_OS === 'WIN') {
                        $this->markTestSkipped('Test not available on Windows OS.');
                }
-               $existingDirectory = PATH_site . 'typo3temp/' . uniqid('notExists_') . '/';
+               $existingDirectory = PATH_site . 'typo3temp/' . $this->getUniqueId('notExists_') . '/';
                mkdir($existingDirectory);
                $this->testFilesToDelete[] = $existingDirectory;
-               $symlinkName = PATH_site . 'typo3temp/' . uniqid('link_');
+               $symlinkName = PATH_site . 'typo3temp/' . $this->getUniqueId('link_');
                symlink($existingDirectory, $symlinkName);
                Utility\GeneralUtility::rmdir($symlinkName, TRUE);
                $this->assertFalse(is_link($symlinkName));
@@ -3410,8 +3410,8 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                if (TYPO3_OS === 'WIN') {
                        $this->markTestSkipped('Test not available on Windows OS.');
                }
-               $notExistingDirectory = PATH_site . 'typo3temp/' . uniqid('notExists_') . '/';
-               $symlinkName = PATH_site . 'typo3temp/' . uniqid('link_');
+               $notExistingDirectory = PATH_site . 'typo3temp/' . $this->getUniqueId('notExists_') . '/';
+               $symlinkName = PATH_site . 'typo3temp/' . $this->getUniqueId('link_');
                symlink($notExistingDirectory, $symlinkName);
                Utility\GeneralUtility::rmdir($symlinkName, TRUE);
                $this->assertFalse(is_link($symlinkName));
@@ -3424,8 +3424,8 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                if (TYPO3_OS === 'WIN') {
                        $this->markTestSkipped('Test not available on Windows OS.');
                }
-               $notExistingFile = PATH_site . 'typo3temp/' . uniqid('notExists_');
-               $symlinkName = PATH_site . 'typo3temp/' . uniqid('link_');
+               $notExistingFile = PATH_site . 'typo3temp/' . $this->getUniqueId('notExists_');
+               $symlinkName = PATH_site . 'typo3temp/' . $this->getUniqueId('link_');
                symlink($notExistingFile, $symlinkName);
                Utility\GeneralUtility::rmdir($symlinkName, TRUE);
                $this->assertFalse(is_link($symlinkName));
@@ -3781,7 +3781,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function splitFileRefReturnsFileTypeNotForFolders() {
-               $directoryName = uniqid('test_') . '.com';
+               $directoryName = $this->getUniqueId('test_') . '.com';
                $directoryPath = PATH_site . 'typo3temp/';
                $directory = $directoryPath . $directoryName;
                mkdir($directory, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']));
@@ -3951,7 +3951,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function makeInstancePassesParametersToConstructor() {
-               $className = 'testingClass' . uniqid();
+               $className = $this->getUniqueId('testingClass');
                if (!class_exists($className, FALSE)) {
                        eval('class ' . $className . ' {' . '  public $constructorParameter1;' . '  public $constructorParameter2;' . '  public function __construct($parameter1, $parameter2) {' . '    $this->constructorParameter1 = $parameter1;' . '    $this->constructorParameter2 = $parameter2;' . '  }' . '}');
                }
@@ -3964,7 +3964,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function makeInstanceInstanciatesConfiguredImplementation() {
-               $classNameOriginal = get_class($this->getMock(uniqid('foo')));
+               $classNameOriginal = get_class($this->getMock($this->getUniqueId('foo')));
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][$classNameOriginal] = array('className' => $classNameOriginal . 'Other');
                eval('class ' . $classNameOriginal . 'Other extends ' . $classNameOriginal . ' {}');
                $this->assertInstanceOf($classNameOriginal . 'Other', Utility\GeneralUtility::makeInstance($classNameOriginal));
@@ -3974,7 +3974,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function makeInstanceResolvesConfiguredImplementationsRecursively() {
-               $classNameOriginal = get_class($this->getMock(uniqid('foo')));
+               $classNameOriginal = get_class($this->getMock($this->getUniqueId('foo')));
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][$classNameOriginal] = array('className' => $classNameOriginal . 'Other');
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][$classNameOriginal . 'Other'] = array('className' => $classNameOriginal . 'OtherOther');
                eval('class ' . $classNameOriginal . 'Other extends ' . $classNameOriginal . ' {}');
@@ -4232,12 +4232,12 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function copyDirectoryCopiesFilesAndDirectoriesWithRelativePaths() {
-               $sourceDirectory = 'typo3temp/' . uniqid('test_') . '/';
+               $sourceDirectory = 'typo3temp/' . $this->getUniqueId('test_') . '/';
                $absoluteSourceDirectory = PATH_site . $sourceDirectory;
                $this->testFilesToDelete[] = $absoluteSourceDirectory;
                Utility\GeneralUtility::mkdir($absoluteSourceDirectory);
 
-               $targetDirectory = 'typo3temp/' . uniqid('test_') . '/';
+               $targetDirectory = 'typo3temp/' . $this->getUniqueId('test_') . '/';
                $absoluteTargetDirectory = PATH_site . $targetDirectory;
                $this->testFilesToDelete[] = $absoluteTargetDirectory;
                Utility\GeneralUtility::mkdir($absoluteTargetDirectory);
@@ -4256,12 +4256,12 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function copyDirectoryCopiesFilesAndDirectoriesWithAbsolutePaths() {
-               $sourceDirectory = 'typo3temp/' . uniqid('test_') . '/';
+               $sourceDirectory = 'typo3temp/' . $this->getUniqueId('test_') . '/';
                $absoluteSourceDirectory = PATH_site . $sourceDirectory;
                $this->testFilesToDelete[] = $absoluteSourceDirectory;
                Utility\GeneralUtility::mkdir($absoluteSourceDirectory);
 
-               $targetDirectory = 'typo3temp/' . uniqid('test_') . '/';
+               $targetDirectory = 'typo3temp/' . $this->getUniqueId('test_') . '/';
                $absoluteTargetDirectory = PATH_site . $targetDirectory;
                $this->testFilesToDelete[] = $absoluteTargetDirectory;
                Utility\GeneralUtility::mkdir($absoluteTargetDirectory);
@@ -4290,7 +4290,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel'] = 0;
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogInit'] = TRUE;
                unset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog']);
-               $testLogFilename = PATH_site . 'typo3temp/' . uniqid('test_') . '.txt';
+               $testLogFilename = PATH_site . 'typo3temp/' . $this->getUniqueId('test_') . '.txt';
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLog'] = 'file,' . $testLogFilename . ',0';
                $GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask'] = '0777';
                // Call method, get actual permissions and clean up
@@ -4308,7 +4308,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('deprecationLogFixesPermissionsOnLogFile() test not available on Windows.');
                }
                // Create extending class and let getDeprecationLogFileName return something within typo3temp/
-               $className = uniqid('GeneralUtility');
+               $className = $this->getUniqueId('GeneralUtility');
                /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Utility\GeneralUtility $subject */
                $subject = __NAMESPACE__ . '\\' . $className;
                eval(
index 588a02b..4187475 100644 (file)
@@ -338,7 +338,7 @@ class PathUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @dataProvider getCanonicalPathCorrectlyCleansPathDataProvider
         */
        public function getCanonicalPathCorrectlyCleansPath($inputName, $expectedResult) {
-               $className = uniqid('PathUtilityFixture');
+               $className = $this->getUniqueId('PathUtilityFixture');
                $fixtureClassString = '
                        namespace ' . ltrim(__NAMESPACE__, '\\') . ';
                        class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\PathUtility {
index 1344018..47f7a54 100644 (file)
@@ -313,9 +313,9 @@ class RootlineUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Utility\RootlineUtility::class, array('columnHasRelationToResolve'), array(1, '', $this->pageContextMock));
                $subject->_set('databaseConnection', $mockDatabaseConnection);
                $GLOBALS['TYPO3_CONF_VARS']['FE']['pageOverlayFields'] = '';
-               $foreign_table = uniqid('foreign_table');
-               $foreign_field = uniqid('foreign_field');
-               $GLOBALS['TCA'][$foreign_table]['ctrl']['enablecolumns']['disabled'] = uniqid('disabled');
+               $foreign_table = $this->getUniqueId('foreign_table');
+               $foreign_field = $this->getUniqueId('foreign_field');
+               $GLOBALS['TCA'][$foreign_table]['ctrl']['enablecolumns']['disabled'] = $this->getUniqueId('disabled');
                $GLOBALS['TCA']['pages']['columns'] = array(
                        'test' => array(
                                'config' => array(
index c85fec1..b5eddb5 100644 (file)
@@ -127,7 +127,7 @@ class VersionNumberUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @param string $expectedVersion
         */
        public function getNumericTypo3VersionNumber($currentVersion, $expectedVersion) {
-               $className = uniqid('VersionNumberUtility');
+               $className = $this->getUniqueId('VersionNumberUtility');
                eval(
                        'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\VersionNumberUtility {' .
index 7122b25..9e40838 100644 (file)
@@ -23,7 +23,7 @@ class AbstractEntityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function objectIsNotDirtyAfterCallingMemorizeCleanStateWithSimpleProperties() {
-               $domainObjectName = uniqid('DomainObject_');
+               $domainObjectName = $this->getUniqueId('DomainObject_');
                $domainObjectNameWithNS = __NAMESPACE__ . '\\' . $domainObjectName;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $domainObjectName . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {
                        public $foo;
@@ -40,7 +40,7 @@ class AbstractEntityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function objectIsDirtyAfterCallingMemorizeCleanStateWithSimplePropertiesAndModifyingThePropertiesAfterwards() {
-               $domainObjectName = uniqid('DomainObject_');
+               $domainObjectName = $this->getUniqueId('DomainObject_');
                $domainObjectNameWithNS = __NAMESPACE__ . '\\' . $domainObjectName;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $domainObjectName . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {
                        public $foo;
@@ -58,7 +58,7 @@ class AbstractEntityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function objectIsNotDirtyAfterCallingMemorizeCleanStateWithObjectProperties() {
-               $domainObjectName = uniqid('DomainObject_');
+               $domainObjectName = $this->getUniqueId('DomainObject_');
                $domainObjectNameWithNS = __NAMESPACE__ . '\\' . $domainObjectName;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $domainObjectName . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {
                        public $foo;
@@ -75,13 +75,13 @@ class AbstractEntityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function objectIsNotDirtyAfterCallingMemorizeCleanStateWithOtherDomainObjectsAsProperties() {
-               $domainObjectName = 'DomainObject_' . md5(uniqid(microtime(), true));
+               $domainObjectName = $this->getUniqueId('DomainObject_');
                $domainObjectNameWithNS = __NAMESPACE__ . '\\' . $domainObjectName;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $domainObjectName . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {
                        public $foo;
                        public $bar;
                }');
-               $secondDomainObjectName = 'DomainObject_' . md5(uniqid(microtime(), true));
+               $secondDomainObjectName = $this->getUniqueId('DomainObject_');
                $secondDomainObjectNameWithNS = __NAMESPACE__ . '\\' . $secondDomainObjectName;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $secondDomainObjectName . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {
                        public $foo;
index 840ca19..4c3da2f 100644 (file)
@@ -23,7 +23,7 @@ class AbstractControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function constructResolvesExtensionnameFromOldStyle() {
-               $className = uniqid('Tx_Extbase_Tests_Fixtures_Controller');
+               $className = $this->getUniqueId('Tx_Extbase_Tests_Fixtures_Controller');
                eval('class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::class . ' { function getExtensionName() { return $this->extensionName; } }');
                $mockController = new $className();
                $expectedResult = 'Extbase';
@@ -35,7 +35,7 @@ class AbstractControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function constructResolvesExtensionnameFromNamespaced() {
-               $className = uniqid('DummyController');
+               $className = $this->getUniqueId('DummyController');
                eval('namespace ' . __NAMESPACE__ . '; class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::class . ' { function getExtensionName() { return $this->extensionName; } }');
                $classNameNamespaced = __NAMESPACE__ . '\\' . $className;
                $mockController = new $classNameNamespaced();
@@ -103,7 +103,7 @@ class AbstractControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $flashMessageQueue = $this->getMock(
                        \TYPO3\CMS\Core\Messaging\FlashMessageQueue::class,
                        array('enqueue'),
-                       array(uniqid('identifier_', TRUE))
+                       array($this->getUniqueId('identifier_'))
                );
                $flashMessageQueue->expects($this->once())->method('enqueue')->with($this->equalTo($expectedMessage));
 
index 116f48f..aaf3b69 100644 (file)
@@ -104,7 +104,7 @@ class JsonViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $output[] = array($object, $configuration, $expected, 'array of objects should be serialized');
 
                $properties = array('foo' => 'bar', 'prohibited' => 'xxx');
-               $nestedObject = $this->getMock('Test' . md5(uniqid(mt_rand(), TRUE)), array('getName', 'getPath', 'getProperties', 'getOther'));
+               $nestedObject = $this->getMock($this->getUniqueId('Test'), array('getName', 'getPath', 'getProperties', 'getOther'));
                $nestedObject->expects($this->any())->method('getName')->will($this->returnValue('name'));
                $nestedObject->expects($this->any())->method('getPath')->will($this->returnValue('path'));
                $nestedObject->expects($this->any())->method('getProperties')->will($this->returnValue($properties));
@@ -206,7 +206,7 @@ class JsonViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * A data provider
         */
        public function exposeClassNameSettingsAndResults() {
-               $className = 'DummyClass' . md5(uniqid(mt_rand(), TRUE));
+               $className = $this->getUniqueId('DummyClass');
                $namespace = 'TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\\' . $className;
                return array(
                        array(
index abe8f51..efc8dc5 100644 (file)
@@ -702,7 +702,7 @@ class UriBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function conversionOfTansientObjectsIsInvoked() {
-               $className = uniqid('FixturesObject_');
+               $className = $this->getUniqueId('FixturesObject_');
                $classNameWithNS = __NAMESPACE__ . '\\' . $className;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $className . ' extends \\TYPO3\\CMS\\Extbase\\DomainObject\\AbstractValueObject { public $name; public $uid; }');
                $mockValueObject = new $classNameWithNS();
@@ -719,7 +719,7 @@ class UriBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException
         */
        public function conversionOfTansientObjectsThrowsExceptionForOtherThanValueObjects() {
-               $className = uniqid('FixturesObject_');
+               $className = $this->getUniqueId('FixturesObject_');
                $classNameWithNS = __NAMESPACE__ . '\\' . $className;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' { public $name; public $uid; }');
                $mockEntity = new $classNameWithNS();
@@ -732,7 +732,7 @@ class UriBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function tansientObjectsAreConvertedToAnArrayOfProperties() {
-               $className = uniqid('FixturesObject_');
+               $className = $this->getUniqueId('FixturesObject_');
                $classNameWithNS = __NAMESPACE__ . '\\' . $className;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject::class . ' { public $name; public $uid; }');
                $mockValueObject = new $classNameWithNS();
@@ -747,18 +747,18 @@ class UriBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function tansientObjectsAreRecursivelyConverted() {
-               $className = 'FixturesObject_' . md5(uniqid(microtime(), true));
+               $className = $this->getUniqueId('FixturesObject_');
                $classNameWithNS = __NAMESPACE__ . '\\' . $className;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject::class . ' { public $name; public $uid; }');
                $mockInnerValueObject2 = new $classNameWithNS();
                $mockInnerValueObject2->name = 'foo';
                $mockInnerValueObject2->uid = 99;
-               $className = 'FixturesObject_' . md5(uniqid(microtime(), true));
+               $className = $this->getUniqueId('FixturesObject_');
                $classNameWithNS = __NAMESPACE__ . '\\' . $className;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject::class . ' { public $object; public $uid; }');
                $mockInnerValueObject1 = new $classNameWithNS();
                $mockInnerValueObject1->object = $mockInnerValueObject2;
-               $className = 'FixturesObject_' . md5(uniqid(microtime(), true));
+               $className = $this->getUniqueId('FixturesObject_');
                $classNameWithNS = __NAMESPACE__ . '\\' . $className;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject::class . ' { public $object; public $uid; }');
                $mockValueObject = new $classNameWithNS();
index 0a79b83..48151d3 100644 (file)
@@ -56,7 +56,7 @@ class DataMapperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function thawPropertiesSetsPropertyValues() {
-               $className = 'Class' . md5(uniqid(mt_rand(), TRUE));
+               $className = $this->getUniqueId('Class');
                $classNameWithNS = __NAMESPACE__ . '\\' . $className;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {
                 public $firstProperty; public $secondProperty; public $thirdProperty; public $fourthProperty;
@@ -164,12 +164,12 @@ class DataMapperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $columnMap->setTypeOfRelation(ColumnMap::RELATION_HAS_ONE);
                $dataMap = $this->getMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap::class, array('getColumnMap'), array(), '', FALSE);
 
-               $className = 'Class1' . md5(uniqid(mt_rand(), TRUE));
+               $className = $this->getUniqueId('Class1');
                $classNameWithNS = __NAMESPACE__ . '\\' . $className;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' { public $relationProperty; }');
                $object = new $classNameWithNS();
 
-               $className2 = 'Class2' . md5(uniqid(mt_rand(), TRUE));
+               $className2 = $this->getUniqueId('Class2');
                $className2WithNS = __NAMESPACE__ . '\\' . $className2;
                eval('namespace ' . __NAMESPACE__ . '; class ' . $className2 . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' { }');
                $child = new $className2WithNS();
index 4d85885..b185359 100644 (file)
@@ -210,7 +210,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function updateSchedulesAnObjectForPersistence() {
-               $className = uniqid('BazFixture');
+               $className = $this->getUniqueId('BazFixture');
                eval ('
                        namespace ' . __NAMESPACE__ . '\\Domain\\Model;
                        class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {
@@ -304,7 +304,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * underscore class names instead of namespaced class names
         */
        public function persistAllAddsReconstitutedObjectFromSessionToBackendsAggregateRootObjects() {
-               $className = uniqid('BazFixture');
+               $className = $this->getUniqueId('BazFixture');
                eval ('
                        class Foo_Bar_Domain_Model_' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {}
                ');
@@ -329,7 +329,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function persistAllAddsNamespacedReconstitutedObjectFromSessionToBackendsAggregateRootObjects() {
-               $className = uniqid('BazFixture');
+               $className = $this->getUniqueId('BazFixture');
                eval ('
                        namespace ' . __NAMESPACE__ . '\\Domain\\Model;
                        class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {}
index d4d6d4b..635f4f3 100644 (file)
@@ -19,7 +19,7 @@ class Typo3DbQueryParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function addSysLanguageStatementWorksForDefaultLanguage() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'][$table]['ctrl'] = array(
                        'languageField' => 'sys_language_uid'
                );
@@ -36,7 +36,7 @@ class Typo3DbQueryParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function addSysLanguageStatementWorksForNonDefaultLanguage() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'][$table]['ctrl'] = array(
                        'languageField' => 'sys_language_uid'
                );
@@ -54,7 +54,7 @@ class Typo3DbQueryParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function addSysLanguageStatementWorksInBackendContextWithNoGlobalTypoScriptFrontendControllerAvailable() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'][$table]['ctrl'] = array(
                        'languageField' => 'sys_language_uid'
                );
@@ -70,7 +70,7 @@ class Typo3DbQueryParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function addSysLanguageStatementWorksForDefaultLanguageWithoutDeleteStatementReturned() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'][$table]['ctrl'] = array(
                        'languageField' => 'sys_language_uid',
                        'delete' => 'deleted'
@@ -88,7 +88,7 @@ class Typo3DbQueryParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function addSysLanguageStatementWorksForForeignLanguageWithoutSubselection() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'][$table]['ctrl'] = array(
                        'languageField' => 'sys_language_uid'
                );
@@ -105,7 +105,7 @@ class Typo3DbQueryParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function addSysLanguageStatementWorksForForeignLanguageWithSubselectionWithoutDeleteStatementReturned() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'][$table]['ctrl'] = array(
                        'languageField' => 'sys_language_uid',
                        'transOrigPointerField' => 'l10n_parent'
@@ -123,7 +123,7 @@ class Typo3DbQueryParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function addSysLanguageStatementWorksForForeignLanguageWithSubselectionTakesDeleteStatementIntoAccountIfNecessary() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $GLOBALS['TCA'][$table]['ctrl'] = array(
                        'languageField' => 'sys_language_uid',
                        'transOrigPointerField' => 'l10n_parent',
@@ -149,7 +149,7 @@ class Typo3DbQueryParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function addSysLanguageStatementWorksInBackendContextWithSubselectionTakesDeleteStatementIntoAccountIfNecessary() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                $table = 'tt_content';
                $GLOBALS['TCA'][$table]['ctrl'] = array(
                        'languageField' => 'sys_language_uid',
@@ -347,7 +347,7 @@ class Typo3DbQueryParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * DataProvider for addPageIdStatement Tests
         */
        public function providerForAddPageIdStatementData() {
-               $table = uniqid('tx_coretest_table');
+               $table = $this->getUniqueId('tx_coretest_table');
                return array(
                        'set Pid to zero if rootLevel = 1' => array(
                                '1',
index 12e8419..dd9e89e 100644 (file)
@@ -172,13 +172,13 @@ class PropertyMapperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function dataProviderForObjectTypeConverters() {
                $data = array();
 
-               $className1 = uniqid('TYPO3_Flow_Testclass1_', FALSE);
-               $className2 = uniqid('TYPO3_Flow_Testclass2_', FALSE);
-               $className3 = uniqid('TYPO3_Flow_Testclass3_', FALSE);
+               $className1 = $this->getUniqueId('TYPO3_Flow_Testclass1_', FALSE);
+               $className2 = $this->getUniqueId('TYPO3_Flow_Testclass2_', FALSE);
+               $className3 = $this->getUniqueId('TYPO3_Flow_Testclass3_', FALSE);
 
-               $interfaceName1 = uniqid('TYPO3_Flow_TestInterface1_', FALSE);
-               $interfaceName2 = uniqid('TYPO3_Flow_TestInterface2_', FALSE);
-               $interfaceName3 = uniqid('TYPO3_Flow_TestInterface3_', FALSE);
+               $interfaceName1 = $this->getUniqueId('TYPO3_Flow_TestInterface1_', FALSE);
+               $interfaceName2 = $this->getUniqueId('TYPO3_Flow_TestInterface2_', FALSE);
+               $interfaceName3 = $this->getUniqueId('TYPO3_Flow_TestInterface3_', FALSE);
 
                eval("
                        interface $interfaceName2 {}
index bcd4cef..4baabd5 100644 (file)
@@ -390,7 +390,7 @@ class DateTimeConverterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function convertFromSupportsDateTimeSubClasses() {
-               $className = 'DateTimeSubClass' . md5(uniqid(mt_rand(), TRUE));
+               $className = $this->getUniqueId('DateTimeSubClass');
                eval('
                        class ' . $className . ' extends \\DateTime {
                                public static function createFromFormat($format, $time, $timezone = NULL) {
index 0445ffd..a04ae3d 100644 (file)
@@ -112,7 +112,7 @@ class PersistentObjectConverterTest extends UnitTestCase {
         * @dataProvider dataProviderForCanConvert
         */
        public function canConvertFromReturnsTrueIfClassIsTaggedWithEntityOrValueObject($isEntity, $isValueObject, $expected) {
-               $className = uniqid('Test_Class');
+               $className = $this->getUniqueId('Test_Class');
                if ($isEntity) {
                        eval("class {$className} extends \\" . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . " {}");
                } elseif ($isValueObject) {
index 56ac8fb..16be97d 100644 (file)
@@ -23,7 +23,7 @@ class ClassSchemaTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function classSchemaForModelIsSetAggregateRootIfRepositoryClassIsFoundForNamespacedClasses() {
-               $className = uniqid('BazFixture');
+               $className = $this->getUniqueId('BazFixture');
                eval ('
                        namespace Foo\\Bar\\Domain\\Model;
                        class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {}
@@ -49,7 +49,7 @@ class ClassSchemaTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function classSchemaForModelIsSetAggregateRootIfRepositoryClassIsFoundForNotNamespacedClasses() {
-               $className = uniqid('BazFixture');
+               $className = $this->getUniqueId('BazFixture');
                eval ('
                        class Foo_Bar_Domain_Model_' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {}
                ');
index c663b18..1248974 100644 (file)
@@ -70,7 +70,7 @@ class FieldProviderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @author Stefan Neufeind <info@speedpartner.de>
         */
        public function constructResolvesExtensionnameFromNamespaced() {
-               $className = uniqid('DummyController');
+               $className = $this->getUniqueId('DummyController');
                eval('namespace ' . __NAMESPACE__ . '; class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::class . ' { function getExtensionName() { return $this->extensionName; } }');
                $classNameNamespaced = __NAMESPACE__ . '\\' . $className;
                $mockController = new $classNameNamespaced();
index a484c58..4d999ac 100644 (file)
@@ -86,7 +86,7 @@ class DispatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function dispatchRetrievesSlotInstanceFromTheObjectManagerIfOnlyAClassNameWasSpecified() {
-               $slotClassName = uniqid('Mock_');
+               $slotClassName = $this->getUniqueId('Mock_');
                eval('class ' . $slotClassName . ' { function slot($foo, $baz) { $this->arguments = array($foo, $baz); } }');
                $mockSlot = new $slotClassName();
                $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
@@ -237,7 +237,7 @@ class DispatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotException
         */
        public function dispatchThrowsAnExceptionIfTheSpecifiedSlotMethodDoesNotExist() {
-               $slotClassName = uniqid('Mock_');
+               $slotClassName = $this->getUniqueId('Mock_');
                eval('class ' . $slotClassName . ' { function slot($foo, $baz) { $this->arguments = array($foo, $baz); } }');
                $mockSlot = new $slotClassName();
                $mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
index 8b24bb9..dd7fe2d 100644 (file)
@@ -103,9 +103,9 @@ class CollectionValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function collectionValidatorValidatesNestedObjectStructuresWithoutEndlessLooping() {
-               $classNameA = 'A' . md5(uniqid(mt_rand(), TRUE));
+               $classNameA = $this->getUniqueId('A');
                eval('class ' . $classNameA . '{ public $b = array(); public $integer = 5; }');
-               $classNameB = 'B' . md5(uniqid(mt_rand(), TRUE));
+               $classNameB = $this->getUniqueId('B');
                eval('class ' . $classNameB . '{ public $a; public $c; public $integer = "Not an integer"; }');
                $A = new $classNameA();
                $B = new $classNameB();
index 5c32b53..0c316fe 100644 (file)
@@ -62,7 +62,7 @@ class GenericObjectValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\Validatio
                $resultWithError1->addError($error1);
                $resultWithError2 = new \TYPO3\CMS\Extbase\Error\Result();
                $resultWithError2->addError($error2);
-               $classNameForObjectWithPrivateProperties = 'B' . md5(uniqid(mt_rand(), TRUE));
+               $classNameForObjectWithPrivateProperties = $this->getUniqueId('B');
                eval('class ' . $classNameForObjectWithPrivateProperties . '{ protected $foo = \'foovalue\'; protected $bar = \'barvalue\'; }');
                $objectWithPrivateProperties = new $classNameForObjectWithPrivateProperties();
                return array(
@@ -97,9 +97,9 @@ class GenericObjectValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\Validatio
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function validateCanHandleRecursiveTargetsWithoutEndlessLooping() {
-               $classNameA = 'B' . md5(uniqid(mt_rand(), TRUE));
+               $classNameA = $this->getUniqueId('B');
                eval('class ' . $classNameA . '{ public $b; }');
-               $classNameB = 'B' . md5(uniqid(mt_rand(), TRUE));
+               $classNameB = $this->getUniqueId('B');
                eval('class ' . $classNameB . '{ public $a; }');
                $A = new $classNameA();
                $B = new $classNameB();
@@ -119,9 +119,9 @@ class GenericObjectValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\Validatio
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function validateDetectsFailuresInRecursiveTargetsI() {
-               $classNameA = 'A' . md5(uniqid(mt_rand(), TRUE));
+               $classNameA = $this->getUniqueId('A');
                eval('class ' . $classNameA . '{ public $b; }');
-               $classNameB = 'B' . md5(uniqid(mt_rand(), TRUE));
+               $classNameB = $this->getUniqueId('B');
                eval('class ' . $classNameB . '{ public $a; public $uuid = 0xF; }');
                $A = new $classNameA();
                $B = new $classNameB();
@@ -146,9 +146,9 @@ class GenericObjectValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\Validatio
         * @author Karsten Dambekalns <karsten@typo3.org>
         */
        public function validateDetectsFailuresInRecursiveTargetsII() {
-               $classNameA = 'A' . md5(uniqid(mt_rand(), TRUE));
+               $classNameA = $this->getUniqueId('A');
                eval('class ' . $classNameA . '{ public $b; public $uuid = 0xF; }');
-               $classNameB = 'B' . md5(uniqid(mt_rand(), TRUE));
+               $classNameB = $this->getUniqueId('B');
                eval('class ' . $classNameB . '{ public $a; public $uuid = 0xF; }');
                $A = new $classNameA();
                $B = new $classNameB();
index b8e7c3d..0692c3d 100644 (file)
@@ -167,7 +167,7 @@ class StringLengthValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $options = array('minimum' => 5, 'maximum' => 100);
                $validator = $this->getMock($this->validatorClassName, array('addError', 'translateErrorMessage'), array($options));
 
-               $className = 'TestClass' . md5(uniqid(mt_rand(), TRUE));
+               $className = $this->getUniqueId('TestClass');
 
                eval('
                        class ' . $className . ' {
@@ -188,7 +188,7 @@ class StringLengthValidatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $options = array('minimum' => 5, 'maximum' => 100);
                $validator = $this->getMock($this->validatorClassName, array('translateErrorMessage'), array($options));
 
-               $className = 'TestClass' . md5(uniqid(mt_rand(), TRUE));
+               $className = $this->getUniqueId('TestClass');
 
                eval('
                        class ' . $className . ' {
index 50f595a..5e75a99 100644 (file)
@@ -55,7 +55,7 @@ class StringValidatorTest extends \TYPO3\CMS\Extbase\Tests\Unit\Validation\Valid
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
        public function stringValidatorShouldReturnErrorIfObjectWithToStringMethodStringIsGiven() {
-               $className = 'TestClass' . md5(uniqid(mt_rand(), TRUE));
+               $className = $this->getUniqueId('TestClass');
                eval('
                        class ' . $className . ' {
                                public function __toString() {
index 44d843f..83d9f0b 100644 (file)
@@ -42,7 +42,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function resolveValidatorObjectNameWithShortHandNotationReturnsValidatorNameIfClassExists() {
                $extensionName = 'tx_foo';
-               $className = uniqid('Foo');
+               $className = $this->getUniqueId('Foo');
                $realClassName = 'Tx_' . $extensionName . '_Validation_Validator_' . $className . 'Validator';
                $validatorName = $extensionName . ':' . $className;
                eval('class ' . $realClassName . ' implements TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface {
@@ -55,7 +55,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function resolveValidatorObjectNameWithShortHandNotationThrowsExceptionIfClassNotExists() {
-               $className = uniqid('Foo');
+               $className = $this->getUniqueId('Foo');
                $validatorName = 'tx_foo:' . $className;
                $this->setExpectedException(\TYPO3\CMS\Extbase\Validation\Exception\NoSuchValidatorException::class, '', 1365799920);
                $this->validatorResolver->_call('resolveValidatorObjectName', $validatorName);
@@ -66,7 +66,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function resolveValidatorObjectNameWithShortHandNotationReturnsValidatorNameIfClassExistsButDoesNotImplementValidatorInterface() {
                $extensionName = 'tx_foo';
-               $className = uniqid('Foo');
+               $className = $this->getUniqueId('Foo');
                $realClassName = 'Tx_' . $extensionName . '_Validation_Validator_' . $className . 'Validator';
                $validatorName = $extensionName . ':' . $className;
                eval('class ' . $realClassName . '{}');
@@ -80,7 +80,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function resolveValidatorObjectNameReturnsValidatorNameIfClassExists() {
-               $className = uniqid('Foo_');
+               $className = $this->getUniqueId('Foo_');
                $expectedValidatorName = $className . 'Validator';
                eval('class ' . $expectedValidatorName . ' implements TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface {
                public function validate($value){} public function getOptions(){}
@@ -95,7 +95,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function resolveValidatorObjectNameThrowsNoSuchValidatorExceptionIfClassNotExists() {
-               $className = uniqid('Foo');
+               $className = $this->getUniqueId('Foo');
                $this->setExpectedException(\TYPO3\CMS\Extbase\Validation\Exception\NoSuchValidatorException::class, '', 1365799920);
                $this->validatorResolver->_call('resolveValidatorObjectName', $className);
        }
@@ -104,7 +104,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function resolveValidatorObjectNameThrowsNoSuchValidatorExceptionIfClassExistsButDoesNotImplementValidatorInterface() {
-               $className = uniqid('Foo_');
+               $className = $this->getUniqueId('Foo_');
                $expectedValidatorName = $className . 'Validator';
                eval('class ' . $expectedValidatorName . '{}');
                $this->setExpectedException(\TYPO3\CMS\Extbase\Validation\Exception\NoSuchValidatorException::class, '', 1365776838);
@@ -152,7 +152,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function createValidatorResolvesAndReturnsAValidatorAndPassesTheGivenOptions() {
-               $className = uniqid('Test');
+               $className = $this->getUniqueId('Test');
                $mockValidator = $this->getMock(\TYPO3\CMS\Extbase\Validation\Validator\ObjectValidatorInterface::class, array('validate', 'getOptions', 'setValidatedInstancesContainer'), array(), $className);
                $this->mockObjectManager->expects($this->any())->method('get')->with($className)->will($this->returnValue($mockValidator));
                /** @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver */
@@ -168,7 +168,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function createValidatorThrowsNoSuchValidatorExceptionIfAValidatorCouldNotBeResolved() {
                $this->markTestSkipped('');
-               $className = uniqid('Test');
+               $className = $this->getUniqueId('Test');
                $this->setExpectedException(\TYPO3\CMS\Extbase\Validation\Exception\NoSuchValidatorException::class, '', 1365799920);
                $this->validatorResolver->createValidator($className);
        }
@@ -367,7 +367,7 @@ class ValidatorResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @author Bastian Waidelich <bastian@typo3.org>
         */
        public function resolveValidatorObjectNameCallsGetValidatorType() {
-               $validatorName = uniqid('FooValidator');
+               $validatorName = $this->getUniqueId('FooValidator');
                eval('namespace TYPO3\CMS\Extbase\Validation\Validator;' . LF . 'class ' . $validatorName . 'Validator implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {
                public function validate($value){} public function getOptions(){}
                }');
index 24bb8a6..7966d9e 100644 (file)
@@ -169,7 +169,7 @@ class ConfigurationItemRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
                $this->assertSame(
                        $expectedArray,
-                       $configurationItemRepository->_call('getConfigurationArrayFromExtensionKey', uniqid('some_extension'))
+                       $configurationItemRepository->_call('getConfigurationArrayFromExtensionKey', $this->getUniqueId('some_extension'))
                );
        }
 
@@ -335,7 +335,7 @@ class ConfigurationItemRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $this->configurationItemRepository->_call(
                        'mergeWithExistingConfiguration',
                        array(),
-                       uniqid('not_existing_extension')
+                       $this->getUniqueId('not_existing_extension')
                );
        }
 
@@ -360,7 +360,7 @@ class ConfigurationItemRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $configuration = $this->configurationItemRepository->_call(
                        'mergeWithExistingConfiguration',
                        $defaultConfiguration,
-                       uniqid('not_existing_extension')
+                       $this->getUniqueId('not_existing_extension')
                );
                $this->assertEquals($defaultConfiguration, $configuration);
        }
index 2243a8b..9c8377f 100644 (file)
@@ -33,7 +33,7 @@ class ConfigurationUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        ->expects($this->once())
                        ->method('getDefaultConfigurationFromExtConfTemplateAsValuedArray')
                        ->will($this->returnValue(array()));
-               $extensionKey = uniqid('some-extension');
+               $extensionKey = $this->getUniqueId('some-extension');
 
                $currentConfiguration = array(
                        'key1' => 'value1',
@@ -148,7 +148,7 @@ class ConfigurationUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        )
                );
 
-               $result = $configurationUtility->getDefaultConfigurationFromExtConfTemplateAsValuedArray(uniqid('some_extension'));
+               $result = $configurationUtility->getDefaultConfigurationFromExtConfTemplateAsValuedArray($this->getUniqueId('some_extension'));
                $this->assertEquals($expected, $result);
        }
 
index aed843c..d2e37e8 100644 (file)
@@ -437,7 +437,7 @@ class DependencyUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $extension2 = new \TYPO3\CMS\Extensionmanager\Domain\Model\Extension();
                $extension2->setExtensionKey('bar');
                $extension2->setVersion('1.0.42');
-               $className = uniqid('objectStorage');
+               $className = $this->getUniqueId('objectStorage');
                eval('class ' . $className . ' {' . 'public $extensions = array();' . 'public function getFirst() {' . '  return $this->extensions[0];' . '}' . '}');
                $myStorage = new $className();
                $myStorage->extensions[] = $extension1;
index 84da335..4cbdc9d 100644 (file)
@@ -33,7 +33,7 @@ class FileHandlingUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @return string The extension key
         */
        protected function createFakeExtension($extkeyOnly = FALSE) {
-               $extKey = strtolower(uniqid('testing'));
+               $extKey = strtolower($this->getUniqueId('testing'));
                $absExtPath = PATH_site . 'typo3temp/ext-' . $extKey . '/';
                $relPath = 'typo3temp/ext-' . $extKey . '/';
                $this->fakedExtensions[$extKey] = array(
@@ -141,7 +141,7 @@ class FileHandlingUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @return void
         */
        public function addDirectoryAddsDirectory() {
-               $extDirPath = PATH_site . '/typo3temp/' . uniqid('test-extensions-', TRUE);
+               $extDirPath = PATH_site . '/typo3temp/' . $this->getUniqueId('test-extensions-');
                $this->testFilesToDelete[] = $extDirPath;
                $fileHandlerMock = $this->getAccessibleMock(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility::class, array('dummy'));
                $fileHandlerMock->_call('addDirectory', $extDirPath);
@@ -153,7 +153,7 @@ class FileHandlingUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @return void
         */
        public function removeDirectoryRemovesDirectory() {
-               $extDirPath = PATH_site . '/typo3temp/' . uniqid('test-extensions-', TRUE);
+               $extDirPath = PATH_site . '/typo3temp/' . $this->getUniqueId('test-extensions-');
                @mkdir($extDirPath);
                $fileHandlerMock = $this->getAccessibleMock(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility::class, array('dummy'));
                $fileHandlerMock->_call('removeDirectory', $extDirPath);
@@ -165,8 +165,8 @@ class FileHandlingUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @return void
         */
        public function removeDirectoryRemovesSymlink() {
-               $absoluteSymlinkPath = PATH_site . 'typo3temp/' . uniqid('test_symlink_');
-               $absoluteFilePath = PATH_site . 'typo3temp/' . uniqid('test_file_');
+               $absoluteSymlinkPath = PATH_site . 'typo3temp/' . $this->getUniqueId('test_symlink_');
+               $absoluteFilePath = PATH_site . 'typo3temp/' . $this->getUniqueId('test_file_');
                touch($absoluteFilePath);
                $this->testFilesToDelete[] = $absoluteFilePath;
                symlink($absoluteFilePath, $absoluteSymlinkPath);
@@ -180,9 +180,9 @@ class FileHandlingUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @return void
         */
        public function removeDirectoryDoesNotRemoveContentOfSymlinkedTargetDirectory() {
-               $absoluteSymlinkPath = PATH_site . 'typo3temp/' . uniqid('test_symlink_');
-               $absoluteDirectoryPath = PATH_site . 'typo3temp/' . uniqid('test_dir_') . '/';
-               $relativeFilePath = uniqid('test_file_');
+               $absoluteSymlinkPath = PATH_site . 'typo3temp/' . $this->getUniqueId('test_symlink_');
+               $absoluteDirectoryPath = PATH_site . 'typo3temp/' . $this->getUniqueId('test_dir_') . '/';
+               $relativeFilePath = $this->getUniqueId('test_file_');
 
                mkdir($absoluteDirectoryPath);
                touch($absoluteDirectoryPath . $relativeFilePath);
index 330d3e9..c14cc49 100644 (file)
@@ -98,7 +98,7 @@ class InstallUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @return string The extension key
         */
        protected function createFakeExtension() {
-               $extKey = strtolower(uniqid('testing'));
+               $extKey = strtolower($this->getUniqueId('testing'));
                $absExtPath = PATH_site . 'typo3temp/' . $extKey;
                $relPath = 'typo3temp/' . $extKey . '/';
                \TYPO3\CMS\Core\Utility\GeneralUtility::mkdir($absExtPath);
index 9c1dea3..ed7771d 100644 (file)
@@ -30,7 +30,7 @@ class AbstractCompilerTemplateTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isDefaultEncodingIsSetThanDefaultEncodingWillReturned() {
-               $className = 'AbstractCompiledTemplate' . uniqid();
+               $className = $this->getUniqueId('AbstractCompiledTemplate');
                $fullClassName = 'TYPO3\\CMS\\Fluid\\Core\\Compiler\\' . $className;
                eval(
                        'namespace TYPO3\\CMS\\Fluid\\Core\\Compiler;' .
index 905810f..0b9199c 100644 (file)
@@ -23,7 +23,7 @@ class AbstractFormFieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHe
                $mockPersistenceManager = $this->getMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
                $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue('6f487e40-4483-11de-8a39-0800200c9a66'));
 
-               $className = 'Object' . uniqid();
+               $className = $this->getUniqueId('Object');
                $fullClassName = 'TYPO3\\Fluid\\ViewHelpers\\Form\\' . $className;
                eval('namespace TYPO3\\Fluid\\ViewHelpers\\Form; class ' . $className . ' {
                        public function __clone() {}
@@ -125,7 +125,7 @@ class AbstractFormFieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHe
                $formViewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('isObjectAccessorMode', 'addAdditionalIdentityPropertiesIfNeeded'), array(), '', FALSE);
                $this->injectDependenciesIntoViewHelper($formViewHelper);
 
-               $className = 'test_' . uniqid();
+               $className = $this->getUniqueId('test_');
                $mockObject = eval('
                        class ' . $className . ' {
                                public function getSomething() {
@@ -250,7 +250,7 @@ class AbstractFormFieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHe
         * @test
         */
        public function addAdditionalIdentityPropertiesIfNeededCallsRenderIdentityFieldWithTheRightParameters() {
-               $className = 'test_' . uniqid();
+               $className = $this->getUniqueId('test_');
                $mockFormObject = eval('
                        class ' . $className . ' {
                                public function getSomething() {
@@ -283,7 +283,7 @@ class AbstractFormFieldViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHe
         * @test
         */
        public function addAdditionalIdentityPropertiesIfNeededCallsRenderIdentityFieldWithTheRightParametersWithMoreHierarchyLevels() {
-               $className = 'test_' . uniqid();
+               $className = $this->getUniqueId('test_');
                $mockFormObject = eval('
                        class ' . $className . ' {
                                public function getSomething() {
index 11343f2..34e0ecf 100644 (file)
@@ -30,7 +30,7 @@ class AbstractFormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers
         * @test
         */
        public function renderHiddenIdentityFieldReturnsAHiddenInputFieldContainingTheObjectsUID() {
-               $className = 'Object' . uniqid();
+               $className = $this->getUniqueId('Object');
                $fullClassName = '\\TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\' . $className;
                eval('namespace TYPO3\\CMS\\Fluid\\ViewHelpers\\Form; class ' . $className . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {
                }');
@@ -47,7 +47,7 @@ class AbstractFormViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers
         * @test
         */
        public function renderHiddenIdentityFieldReturnsAHiddenInputFieldIfObjectIsNewButAClone() {
-               $className = 'Object' . uniqid();
+               $className = $this->getUniqueId('Object');
                eval('class ' . $className . ' extends TYPO3\\CMS\\Extbase\\DomainObject\\AbstractEntity {
                }');
                $object = $this->getAccessibleMock($className, array('dummy'));