File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,15 +39,21 @@ public function import(array $dataSet): void
3939 $ tableDetails = $ connection ->getSchemaManager ()->listTableDetails ($ tableName );
4040 } elseif (method_exists ($ connection , 'getSchemaInformation ' )) {
4141 // >= 13
42- $ tableDetails = $ connection ->getSchemaInformation ()->introspectTable ($ tableName );
42+ $ tableDetails = $ connection ->getSchemaInformation ()->getTableInfo ($ tableName );
4343 } else {
4444 throw new RuntimeException ('Could not check the schema for table: ' . $ tableName , 1707144020 );
4545 }
4646
4747 foreach ($ records as $ record ) {
4848 $ types = [];
4949 foreach (array_keys ($ record ) as $ columnName ) {
50- $ types [] = $ tableDetails ->getColumn ((string )$ columnName )->getType ()->getBindingType ();
50+ $ columnInfo = $ tableDetails ->getColumnInfo ((string )$ columnName );
51+
52+ if ($ columnInfo === null ) {
53+ throw new RuntimeException ('Could not get info for column " ' . $ columnName . '" of table: ' . $ tableName , 1760697878 );
54+ }
55+
56+ $ types [] = $ columnInfo ->getType ()->getBindingType ();
5157 }
5258
5359 $ connection ->insert ($ tableName , $ record , $ types );
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ public function failsIfSqlError(): void
8282 $ this ->expectExceptionMessageMatches (
8383 '#Error for PHP data-set " ' . __DIR__ . '/Fixtures/WithBrokenSql.php": '
8484 . PHP_EOL
85- . 'There is no column with name .* none_existing_column.* on table .* pages.*\. # '
85+ . 'Could not get info for column " none_existing_column" of table: pages# '
8686 );
8787 $ this ->importPHPDataSet (__DIR__ . '/Fixtures/WithBrokenSql.php ' );
8888 }
You can’t perform that action at this time.
0 commit comments