[BUGFIX] Make Functional tests work on fast machines
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Functional / DataHandling / Framework / ActionService.php
index afe5f7d..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) {
@@ -227,9 +227,10 @@ class ActionService {
         * @param string $tableName
         * @param integer $uid
         * @param integer $pageId
+        * @param NULL|array $recordData
         * @return array
         */
-       public function copyRecord($tableName, $uid, $pageId) {
+       public function copyRecord($tableName, $uid, $pageId, array $recordData = NULL) {
                $commandMap = array(
                        $tableName => array(
                                $uid => array(
@@ -237,6 +238,13 @@ class ActionService {
                                ),
                        ),
                );
+               if ($recordData !== NULL) {
+                       $commandMap[$tableName][$uid]['copy'] = array(
+                               'action' => 'paste',
+                               'target' => $pageId,
+                               'update' => $recordData,
+                       );
+               }
                $this->createDataHandler();
                $this->dataHandler->start(array(), $commandMap);
                $this->dataHandler->process_cmdmap();
@@ -247,8 +255,9 @@ class ActionService {
         * @param string $tableName
         * @param integer $uid
         * @param integer $pageId
+        * @param NULL|array $recordData
         */
-       public function moveRecord($tableName, $uid, $pageId) {
+       public function moveRecord($tableName, $uid, $pageId, array $recordData = NULL) {
                $commandMap = array(
                        $tableName => array(
                                $uid => array(
@@ -256,6 +265,13 @@ class ActionService {
                                ),
                        ),
                );
+               if ($recordData !== NULL) {
+                       $commandMap[$tableName][$uid]['move'] = array(
+                               'action' => 'paste',
+                               'target' => $pageId,
+                               'update' => $recordData,
+                       );
+               }
                $this->createDataHandler();
                $this->dataHandler->start(array(), $commandMap);
                $this->dataHandler->process_cmdmap();