Skip to content

Fix tests #6481

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

Merged
merged 1 commit into from
Aug 2, 2024
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
10 changes: 7 additions & 3 deletions tests/Functional/Schema/SQLiteSchemaManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLitePlatform;
use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Schema\TableDiff;
Expand Down Expand Up @@ -220,9 +221,12 @@ public function testAlterTableWithSchema(): void

self::assertSame(['a'], array_keys($this->schemaManager->listTableColumns('t')));

$tableDiff = new TableDiff($table, [], [], [], [
'a' => new Column('b', Type::getType(Types::INTEGER)),
], [], [], [], [], [], [], []);
$tableDiff = new TableDiff($table, changedColumns: [
'a' => new ColumnDiff(
new Column('a', Type::getType(Types::INTEGER)),
new Column('b', Type::getType(Types::INTEGER)),
),
]);
$this->schemaManager->alterTable($tableDiff);

self::assertSame(['b'], array_keys($this->schemaManager->listTableColumns('t')));
Expand Down
9 changes: 6 additions & 3 deletions tests/Platforms/SQLitePlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,12 @@ public function testGeneratesAlterTableRenameColumnSQLWithSchema(): void
$table = new Table('main.t');
$table->addColumn('a', Types::INTEGER);

$tableDiff = new TableDiff($table, [], [], [], [
'a' => new Column('b', Type::getType(Types::INTEGER)),
], [], [], [], [], [], [], []);
$tableDiff = new TableDiff($table, changedColumns: [
'a' => new ColumnDiff(
new Column('a', Type::getType(Types::INTEGER)),
new Column('b', Type::getType(Types::INTEGER)),
),
]);

self::assertSame([
'CREATE TEMPORARY TABLE __temp__t AS SELECT a FROM main.t',
Expand Down
2 changes: 1 addition & 1 deletion tests/Schema/AbstractComparatorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public function testCompareForeignKeyBasedOnPropertiesNotName(): void
$tableB->addForeignKeyConstraint('bar', ['id'], ['id'], [], 'bar_constraint');

self::assertEquals(
new TableDiff($tableA, [], [], [], [], [], [], [], [], [], [], []),
new TableDiff($tableA),
$this->comparator->compareTables($tableA, $tableB),
);
}
Expand Down
Loading