[BUGFIX] Make Functional tests work on fast machines 14/30914/2
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Thu, 12 Jun 2014 14:02:20 +0000 (16:02 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 20 Jun 2014 10:21:36 +0000 (12:21 +0200)
Adds more entropy to the uniqid() call. So each call inside
foreach loop will generate unique value.
As uniqid() generates values based on current time,
subsequent calls may return the same value on a fast machine.

On Windows it's even worse, as uniqid()
has single-second-resolution out of the box.

Resolves: #59529
Relates: #58602
Releases: 6.3, 6,2
Change-Id: I7476f85961e906905acaca7fd816e37375c9817c
Reviewed-on: https://review.typo3.org/30696
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
(cherry picked from commit 86c63e3be8888b1a065d0585bb4c94ff1498336b)
Reviewed-on: https://review.typo3.org/30914

typo3/sysext/core/Tests/Functional/DataHandling/Framework/ActionService.php

index 2e016eb..264cd58 100644 (file)
@@ -69,7 +69,7 @@ class ActionService {
                        if (!isset($recordData['pid'])) {
                                $recordData['pid'] = $pageId;
                        }
                        if (!isset($recordData['pid'])) {
                                $recordData['pid'] = $pageId;
                        }
-                       $currentUid = uniqid('NEW');
+                       $currentUid = uniqid('NEW', TRUE);
                        $newTableIds[$tableName][] = $currentUid;
                        $dataMap[$tableName][$currentUid] = $recordData;
                        if ($previousTableName !== NULL && $previousUid !== NULL) {
                        $newTableIds[$tableName][] = $currentUid;
                        $dataMap[$tableName][$currentUid] = $recordData;
                        if ($previousTableName !== NULL && $previousUid !== NULL) {