[BUGFIX] Tests: Create NEWid values the same way as DataHandler 25/42625/3
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 14 Aug 2015 08:24:34 +0000 (10:24 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 20 Aug 2015 16:44:30 +0000 (18:44 +0200)
The NEWid values generated in the functions tests of the core use a
different kind of NEWid value that is longer than the values created
within DataHandler. The length of the values generated in the tests
exceeds the length of the database column in the sys_log table, leading
to errors when running MySQL in strict mode.

This change uses the same code as DataHandler to generate NEWid values.

Resolves: #69039
Releases: master
Change-Id: I4380fb333a15d37b9a48b98b211a9143286ec73b
Reviewed-on: http://review.typo3.org/42625
Reviewed-by: Stephan GroƟberndt <stephan@grossberndt.de>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Tests/Functional/DataHandling/Framework/ActionService.php

index c8573c3..877f582 100644 (file)
@@ -59,8 +59,7 @@ class ActionService {
                        if (!isset($recordData['pid'])) {
                                $recordData['pid'] = $pageId;
                        }
-                       // @see \TYPO3\CMS\Core\Tests\BaseTestCase->getUniqueId()
-                       $currentUid = 'NEW' . str_replace('.', '', uniqid(mt_rand(), TRUE));
+                       $currentUid = uniqid('NEW', TRUE);
                        $newTableIds[$tableName][] = $currentUid;
                        $dataMap[$tableName][$currentUid] = $recordData;
                        if ($previousTableName !== NULL && $previousUid !== NULL) {
@@ -132,8 +131,7 @@ class ActionService {
                        $currentUid = $recordData['uid'];
                        if ($recordData['uid'] === '__NEW') {
                                $recordData['pid'] = $pageId;
-                               // @see \TYPO3\CMS\Core\Tests\BaseTestCase->getUniqueId()
-                               $currentUid = 'NEW' . str_replace('.', '', uniqid(mt_rand(), TRUE));
+                               $currentUid = uniqid('NEW', TRUE);
                        }
                        unset($recordData['uid']);
                        $dataMap[$tableName][$currentUid] = $recordData;