Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Don't skip column options. #3089

Merged
merged 1 commit into from
Apr 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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