[BUGFIX] Replace uniqid() usages in Tests 56/37856/4
authorStephan Großberndt <stephan@grossberndt.de>
Sun, 15 Mar 2015 13:32:12 +0000 (14:32 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Sun, 15 Mar 2015 18:19:39 +0000 (19:19 +0100)
Replace usage of uniqid() with BaseTestCase->getUniqueId() and correct
method name in comments.

Resolves: #65744
Releases: master
Change-Id: I492c0aafb7ec58085872e031a5ec9ce234f301f2
Reviewed-on: http://review.typo3.org/37856
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/core/Tests/Functional/DataHandling/Framework/ActionService.php
typo3/sysext/frontend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php
typo3/sysext/install/Tests/Unit/Service/CoreVersionServiceTest.php

index 50a9be4..52bf8dd 100644 (file)
@@ -59,7 +59,7 @@ class ActionService {
                        if (!isset($recordData['pid'])) {
                                $recordData['pid'] = $pageId;
                        }
-                       // @see \TYPO3\CMS\Core\Tests\BaseTestCase->uniqid()
+                       // @see \TYPO3\CMS\Core\Tests\BaseTestCase->getUniqueId()
                        $currentUid = 'NEW' . str_replace('.', '', uniqid(mt_rand(), TRUE));
                        $newTableIds[$tableName][] = $currentUid;
                        $dataMap[$tableName][$currentUid] = $recordData;
@@ -132,7 +132,7 @@ class ActionService {
                        $currentUid = $recordData['uid'];
                        if ($recordData['uid'] === '__NEW') {
                                $recordData['pid'] = $pageId;
-                               // @see \TYPO3\CMS\Core\Tests\BaseTestCase->uniqid()
+                               // @see \TYPO3\CMS\Core\Tests\BaseTestCase->getUniqueId()
                                $currentUid = 'NEW' . str_replace('.', '', uniqid(mt_rand(), TRUE));
                        }
                        unset($recordData['uid']);
index 5919dd7..dacc096 100644 (file)
@@ -444,7 +444,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function globalVarConditionMatchesOnArrayExpressionWithZeroAsKey() {
-               $testKey = uniqid('test');
+               $testKey = $this->getUniqueId('test');
                $testValue = '1';
                $_GET = array();
                $_POST = array($testKey => array('0' => $testValue));
index d704381..be455e6 100644 (file)
@@ -26,7 +26,7 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\CoreVersionService::class, array('fetchVersionMatrixFromRemote'), array(), '', FALSE);
                $registry = $this->getMock(\TYPO3\CMS\Core\Registry::class);
-               $versionArray = array(uniqId());
+               $versionArray = array($this->getUniqueId());
                $registry->expects($this->once())->method('set')->with('TYPO3.CMS.Install', 'coreVersionMatrix', $versionArray);
                $instance->_set('registry', $registry);
                $instance->expects($this->once())->method('fetchVersionMatrixFromRemote')->will($this->returnValue($versionArray));
@@ -378,7 +378,7 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\CoreVersionService::class, array('fetchVersionMatrixFromRemote'), array(), '', FALSE);
                $registry = $this->getMock(\TYPO3\CMS\Core\Registry::class);
-               $versionArray = array(uniqId());
+               $versionArray = array($this->getUniqueId());
                $registry->expects($this->once())->method('get')->will($this->returnValue($versionArray));
                $instance->_set('registry', $registry);
                $this->assertSame($versionArray, $instance->_call('getVersionMatrix'));