[BUGFIX] Make Functional tests work on fast machines 96/30696/7
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:13:33 +0000 (12:13 +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
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;
                        }
-                       $currentUid = uniqid('NEW');
+                       $currentUid = uniqid('NEW', TRUE);
                        $newTableIds[$tableName][] = $currentUid;
                        $dataMap[$tableName][$currentUid] = $recordData;
                        if ($previousTableName !== NULL && $previousUid !== NULL) {