Skip to content

Commit

Permalink
Fixing rebase with master
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermeblanco authored and morozov committed Jan 4, 2018
1 parent d7d1c39 commit c71b3ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions lib/Doctrine/DBAL/Schema/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -579,19 +579,24 @@ public function removeUniqueConstraint($constraintName)
*/
public function getColumns()
{
$pkCols = [];
$fkCols = [];
$columns = $this->_columns;
$pkCols = [];
$fkCols = [];

if ($this->hasPrimaryKey()) {
$pkCols = $this->filterColumns($this->getPrimaryKey()->getColumns());
$pkCols = $this->getPrimaryKey()->getColumns();
}

foreach ($this->getForeignKeys() as $fk) {
/* @var $fk ForeignKeyConstraint */
$fkCols = array_merge($fkCols, $fk->getColumns());
}

$columns = array_unique(array_merge($pkCols, $fkCols, array_keys($this->_columns)));
$colNames = array_unique(array_merge($pkCols, $fkCols, array_keys($columns)));

uksort($columns, function ($a, $b) use ($colNames) {
return (array_search($a, $colNames) >= array_search($b, $colNames));
});

return $columns;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MysqliConnectionTest extends DbalTestCase

protected function setUp()
{
if ( ! extension_loaded('mysqli')) {
if (! extension_loaded('mysqli')) {
$this->markTestSkipped('mysqli is not installed.');
}

Expand All @@ -42,7 +42,7 @@ public function testRestoresErrorHandlerOnException()
new MysqliConnection(['host' => '255.255.255.255'], 'user', 'pass');
self::fail('An exception was supposed to be raised');
} catch (MysqliException $e) {
self::assertSame('Network is unreachable', $e->getMessage());
// Do nothing
}

self::assertSame($handler, set_error_handler($default_handler), 'Restoring error handler failed.');
Expand Down

0 comments on commit c71b3ae

Please sign in to comment.