[TASK] Check whether data was successfully imported in the functional test 40/23640/2
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Thu, 5 Sep 2013 15:17:35 +0000 (17:17 +0200)
committerPhilipp Gampe <philipp.gampe@typo3.org>
Sun, 8 Sep 2013 11:36:06 +0000 (13:36 +0200)
Exception is thrown when fixture data can not be loaded into database.

Resolves: #51783
Releases: 6.2
Change-Id: If23657555940cb98954e0ec72ee7d8be53bea1b4
Reviewed-on: https://review.typo3.org/23640
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
typo3/sysext/core/Tests/FunctionalTestCase.php

index a0379a5..1afa897 100644 (file)
@@ -52,7 +52,7 @@ namespace TYPO3\CMS\Core\Tests;
  * - ./typo3conf/ext/phpunit/Composer/vendor/bin/phpunit \
  *     --process-isolation \
  *     --bootstrap typo3/sysext/core/Build/FunctionalTestsBootstrap.php \
- *     typo3/sysext/core/Tests/Functional/Functional/FunctionalTestCaseTest.php
+ *     typo3/sysext/core/Tests/Functional/DataHandling/DataHandlerTest.php
  */
 abstract class FunctionalTestCase extends BaseTestCase {
 
@@ -223,8 +223,13 @@ abstract class FunctionalTestCase extends BaseTestCase {
                        }
 
                        $tableName = $table->getName();
-                       $database->exec_INSERTquery($tableName, $insertArray);
-
+                       $result = $database->exec_INSERTquery($tableName, $insertArray);
+                       if ($result === FALSE) {
+                               throw new Exception(
+                                       'Error when processing fixture file: ' . $path . ' Can not insert data to table ' . $tableName,
+                                       1376746262
+                               );
+                       }
                        if (isset($table['id'])) {
                                $elementId = (string) $table['id'];
                                $foreignKeys[$tableName][$elementId] = $database->sql_insert_id();