File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
tests/Doctrine/Tests/DBAL/Driver/Mysqli Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -579,19 +579,24 @@ public function removeUniqueConstraint($constraintName)
579
579
*/
580
580
public function getColumns ()
581
581
{
582
- $ pkCols = [];
583
- $ fkCols = [];
582
+ $ columns = $ this ->_columns ;
583
+ $ pkCols = [];
584
+ $ fkCols = [];
584
585
585
586
if ($ this ->hasPrimaryKey ()) {
586
- $ pkCols = $ this ->filterColumns ( $ this -> getPrimaryKey ()->getColumns () );
587
+ $ pkCols = $ this ->getPrimaryKey ()->getColumns ();
587
588
}
588
589
589
590
foreach ($ this ->getForeignKeys () as $ fk ) {
590
591
/* @var $fk ForeignKeyConstraint */
591
592
$ fkCols = array_merge ($ fkCols , $ fk ->getColumns ());
592
593
}
593
594
594
- $ columns = array_unique (array_merge ($ pkCols , $ fkCols , array_keys ($ this ->_columns )));
595
+ $ colNames = array_unique (array_merge ($ pkCols , $ fkCols , array_keys ($ columns )));
596
+
597
+ uksort ($ columns , function ($ a , $ b ) use ($ colNames ) {
598
+ return (array_search ($ a , $ colNames ) >= array_search ($ b , $ colNames ));
599
+ });
595
600
596
601
return $ columns ;
597
602
}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class MysqliConnectionTest extends DbalTestCase
17
17
18
18
protected function setUp ()
19
19
{
20
- if ( ! extension_loaded ('mysqli ' )) {
20
+ if (! extension_loaded ('mysqli ' )) {
21
21
$ this ->markTestSkipped ('mysqli is not installed. ' );
22
22
}
23
23
@@ -42,7 +42,7 @@ public function testRestoresErrorHandlerOnException()
42
42
new MysqliConnection (['host ' => '255.255.255.255 ' ], 'user ' , 'pass ' );
43
43
self ::fail ('An exception was supposed to be raised ' );
44
44
} catch (MysqliException $ e ) {
45
- self :: assertSame ( ' Network is unreachable ' , $ e -> getMessage ());
45
+ // Do nothing
46
46
}
47
47
48
48
self ::assertSame ($ handler , set_error_handler ($ default_handler ), 'Restoring error handler failed. ' );
You can’t perform that action at this time.
0 commit comments