Skip to content

Commit

Permalink
Merge branch 'bpo/2.7/doctrine#3089' into 2.7
Browse files Browse the repository at this point in the history
Backporting doctrine#3089 into 2.7
  • Loading branch information
Majkl578 committed Apr 6, 2018
2 parents 62be858 + 1bf8e3a commit 2f64799
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Schema/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function setOptions(array $options)
$name
), E_USER_DEPRECATED);

return $this;
continue;
}
$this->$method($value);
}
Expand Down
13 changes: 13 additions & 0 deletions tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ public function testSettingUnknownOptionIsStillSupported() : void
new Column('foo', $this->createMock(Type::class), ['unknown_option' => 'bar']);
}

/**
* @group legacy
* @expectedDeprecation The "unknown_option" column option is not supported, setting it is deprecated and will cause an error in Doctrine 3.0
*/
public function testOptionsShouldNotBeIgnored() : void
{
$col1 = new Column('bar', Type::getType(Type::INTEGER), ['unknown_option' => 'bar', 'notnull' => true]);
self::assertTrue($col1->getNotnull());

$col2 = new Column('bar', Type::getType(Type::INTEGER), ['unknown_option' => 'bar', 'notnull' => false]);
self::assertFalse($col2->getNotnull());
}

/**
* @return Column
*/
Expand Down

0 comments on commit 2f64799

Please sign in to comment.