Skip to content

Commit 754ad25

Browse files
committed
Fixed tests failing on the lowest dependencies version
1 parent a022338 commit 754ad25

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableSchemaCommandTest.php

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,36 @@ public function test_run_db_table_list() : void
5757

5858
$tester->assertCommandIsSuccessful();
5959

60-
self::assertSame(
61-
<<<'PHP'
60+
61+
// changeColumn was removed in doctrine/dbal 4.0
62+
// We are using it to perform a different assertion since prior to 4.0 all
63+
// columns were also getting precision set to 10 due to a bug that was executing precision set
64+
// even when precision value was null.
65+
if (!\method_exists(Table::class, 'changeColumn')) {
66+
self::assertSame(
67+
<<<'PHP'
6268
\Flow\ETL\DSL\schema(
6369
\Flow\ETL\DSL\integer_schema("id", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_primary" => "table_01_pkey"])),
6470
\Flow\ETL\DSL\string_schema("name", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_length" => 255])),
6571
\Flow\ETL\DSL\string_schema("description", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_length" => 255])),
6672
);
6773

6874
PHP,
69-
$tester->getDisplay()
70-
);
75+
$tester->getDisplay()
76+
);
77+
} else {
78+
self::assertSame(
79+
<<<'PHP'
80+
\Flow\ETL\DSL\schema(
81+
\Flow\ETL\DSL\integer_schema("id", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_precision" => 10, "dbal_column_primary" => "table_01_pkey"])),
82+
\Flow\ETL\DSL\string_schema("name", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_length" => 255, "dbal_column_precision" => 10])),
83+
\Flow\ETL\DSL\string_schema("description", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_length" => 255, "dbal_column_precision" => 10])),
84+
);
85+
86+
PHP,
87+
$tester->getDisplay()
88+
);
89+
}
7190
}
7291

7392
protected function dbContext() : DatabaseContext

0 commit comments

Comments
 (0)