Skip to content

Commit 89529ce

Browse files
committed
[BUGFIX] Ensure proper test setup related to doctrine/dbal
With doctrine/dbal v3.5.0 some changes has been introduced which shows invalid test setup. This change use proper test setup to be okay again, if doctrine/dbal v3.5.0 is used. See: doctrine/dbal#5770 Used command(s): > Build/Scripts/runTests.sh -s phpstanGenerateBaseline Resolves: #98704 Releases: main Change-Id: I936e5cd291086020e60be418176b0f294fb43a45 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76231 Tested-by: core-ci <[email protected]> Tested-by: Christian Kuhn <[email protected]> Tested-by: Andreas Fernandez <[email protected]> Tested-by: Stefan Bürk <[email protected]> Reviewed-by: Christian Kuhn <[email protected]> Reviewed-by: Andreas Fernandez <[email protected]> Reviewed-by: Stefan Bürk <[email protected]>
1 parent 613f487 commit 89529ce

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

Build/phpstan/phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,11 +1545,6 @@ parameters:
15451545
count: 1
15461546
path: ../../typo3/sysext/core/Tests/Unit/Database/RelationHandlerTest.php
15471547

1548-
-
1549-
message: "#^Parameter \\#1 \\$newTables of class Doctrine\\\\DBAL\\\\Schema\\\\SchemaDiff constructor expects array\\<Doctrine\\\\DBAL\\\\Schema\\\\Table\\>, null given\\.$#"
1550-
count: 1
1551-
path: ../../typo3/sysext/core/Tests/Unit/Database/Schema/ConnectionMigratorTest.php
1552-
15531548
-
15541549
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with 0 and string\\|null will always evaluate to false\\.$#"
15551550
count: 1

typo3/sysext/core/Tests/Unit/Database/Schema/ConnectionMigratorTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use TYPO3\CMS\Core\Database\Connection;
2929
use TYPO3\CMS\Core\Database\Platform\PlatformInformation;
3030
use TYPO3\CMS\Core\Database\Schema\ConnectionMigrator;
31-
use TYPO3\CMS\Core\Utility\GeneralUtility;
3231
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
3332

3433
/**
@@ -73,7 +72,7 @@ protected function setUp(): void
7372
*/
7473
public function tableNamesStickToTheMaximumCharactersWhenPrefixedForRemoval(): void
7574
{
76-
$originalSchemaDiff = GeneralUtility::makeInstance(SchemaDiff::class, null, null, [$this->getTable()]);
75+
$originalSchemaDiff = new SchemaDiff([], [], [$this->getTable()]);
7776
$renamedSchemaDiff = $this->subject->_call('migrateUnprefixedRemovedTablesToRenames', $originalSchemaDiff);
7877

7978
self::assertStringStartsWith('zzz_deleted_', $renamedSchemaDiff->changedTables[0]->newName);
@@ -89,9 +88,8 @@ public function tableNamesStickToTheMaximumCharactersWhenPrefixedForRemoval(): v
8988
public function columnNamesStickToTheMaximumCharactersWhenPrefixedForRemoval(): void
9089
{
9190
$table = $this->getTable();
92-
$tableDiff = new TableDiff($table->getName());
93-
$originalSchemaDiff = new SchemaDiff(null, [$tableDiff]);
94-
$originalSchemaDiff->changedTables[0]->removedColumns[] = $this->getColumn();
91+
$tableDiff = new TableDiff($table->getName(), [], [], [$this->getColumn()]);
92+
$originalSchemaDiff = new SchemaDiff([], [$tableDiff]);
9593
$renamedSchemaDiff = $this->subject->_call('migrateUnprefixedRemovedFieldsToRenames', $originalSchemaDiff);
9694

9795
self::assertStringStartsWith(

0 commit comments

Comments
 (0)