Unverified Commit 5a7dc82f authored by alexpott's avatar alexpott
Browse files

Issue #2616724 follow-up by alexpott: Warn when trying to create a database...

Issue #2616724 follow-up by alexpott: Warn when trying to create a database table with a NOT NULL => FALSE primary key
parent ca1574e3
......@@ -828,8 +828,7 @@ public function testInvalidPrimaryKeyOnTableCreation() {
],
'primary key' => ['test_field'],
];
$this->expectException(SchemaException::class);
$this->expectExceptionMessage("The 'test_field' field specification does not define 'not null' as TRUE.");
$this->setExpectedException(SchemaException::class, "The 'test_field' field specification does not define 'not null' as TRUE.");
$schema->createTable($table_name, $table_spec);
}
......@@ -850,8 +849,7 @@ public function testInvalidPrimaryKeyAddition() {
];
$schema->createTable($table_name, $table_spec);
$this->expectException(SchemaException::class);
$this->expectExceptionMessage("The 'new_test_field' field specification does not define 'not null' as TRUE.");
$this->setExpectedException(SchemaException::class, "The 'new_test_field' field specification does not define 'not null' as TRUE.");
$schema->addField($table_name, 'new_test_field', ['type' => 'int'], ['primary key' => ['test_field', 'new_test_field']]);
}
......@@ -872,8 +870,7 @@ public function testInvalidPrimaryKeyChange() {
];
$schema->createTable($table_name, $table_spec);
$this->expectException(SchemaException::class);
$this->expectExceptionMessage("The 'changed_test_field' field specification does not define 'not null' as TRUE.");
$this->setExpectedException(SchemaException::class, "The 'changed_test_field' field specification does not define 'not null' as TRUE.");
$schema->dropPrimaryKey($table_name);
$schema->changeField($table_name, 'test_field', 'changed_test_field', ['type' => 'int'], ['primary key' => ['changed_test_field']]);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment