From 20f6cec4bdcc626c35b8002ac7a36654fb914efa Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Tue, 8 Aug 2023 10:49:33 +0200 Subject: [PATCH] PHPUnit 10.4.0 --- composer.json | 2 +- psalm.xml.dist | 4 ++-- tests/ConnectionTest.php | 4 ++-- .../Schema/SchemaManagerFunctionalTestCase.php | 10 ++++++++++ tests/Functional/Schema/SqliteSchemaManagerTest.php | 1 + tests/Platforms/AbstractMySQLPlatformTestCase.php | 4 ++-- tests/Platforms/MySQL/ComparatorTest.php | 4 ++-- tests/Schema/Platforms/MySQLSchemaTest.php | 4 ++-- 8 files changed, 22 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 59208bdd9f2..4d943ddb0c5 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "phpstan/phpstan": "1.10.35", "phpstan/phpstan-phpunit": "1.3.14", "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "10.2.2", + "phpunit/phpunit": "10.4.0", "psalm/plugin-phpunit": "0.18.4", "slevomat/coding-standard": "8.13.1", "squizlabs/php_codesniffer": "3.7.2", diff --git a/psalm.xml.dist b/psalm.xml.dist index 9615d8e366a..fa949b53ddd 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -44,8 +44,8 @@ - - + + diff --git a/tests/ConnectionTest.php b/tests/ConnectionTest.php index 5c797f53523..1312fa3eb8f 100644 --- a/tests/ConnectionTest.php +++ b/tests/ConnectionTest.php @@ -196,7 +196,7 @@ public function testRollBackStartsTransactionInNoAutoCommitMode(): void public function testSwitchingAutoCommitModeCommitsAllCurrentTransactions(): void { - $platform = $this->createStub(AbstractPlatform::class); + $platform = self::createStub(AbstractPlatform::class); $platform ->method('supportsSavepoints') ->willReturn(true); @@ -610,7 +610,7 @@ public function testConnectionParamsArePassedToTheQueryCacheProfileInExecuteCach public function testCustomSchemaManagerFactory(): void { - $schemaManager = $this->createStub(AbstractSchemaManager::class); + $schemaManager = self::createStub(AbstractSchemaManager::class); $factory = $this->createMock(SchemaManagerFactory::class); $factory->expects(self::once())->method('createSchemaManager')->willReturn($schemaManager); diff --git a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php index 1b8462ee826..23238204af8 100644 --- a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php +++ b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php @@ -77,6 +77,16 @@ protected function tearDown(): void $this->connection->executeStatement('DROP SCHEMA testschema'); } catch (Exception) { } + + try { + $this->connection->executeStatement('DROP VIEW test_view'); + } catch (Exception) { + } + + try { + $this->connection->executeStatement('DROP VIEW doctrine_test_view'); + } catch (Exception) { + } } public function testCreateSequence(): void diff --git a/tests/Functional/Schema/SqliteSchemaManagerTest.php b/tests/Functional/Schema/SqliteSchemaManagerTest.php index c6668355433..76b6e57d2a0 100644 --- a/tests/Functional/Schema/SqliteSchemaManagerTest.php +++ b/tests/Functional/Schema/SqliteSchemaManagerTest.php @@ -42,6 +42,7 @@ public function createListTableColumns(): Table public function testListForeignKeysFromExistingDatabase(): void { + $this->connection->executeStatement('DROP TABLE IF EXISTS user'); $this->connection->executeStatement(<<<'EOS' CREATE TABLE user ( id INTEGER PRIMARY KEY AUTOINCREMENT, diff --git a/tests/Platforms/AbstractMySQLPlatformTestCase.php b/tests/Platforms/AbstractMySQLPlatformTestCase.php index 098698e4b6c..4a48e89f0cf 100644 --- a/tests/Platforms/AbstractMySQLPlatformTestCase.php +++ b/tests/Platforms/AbstractMySQLPlatformTestCase.php @@ -675,8 +675,8 @@ protected function createComparator(): Comparator { return new MySQL\Comparator( $this->platform, - $this->createStub(CharsetMetadataProvider::class), - $this->createStub(CollationMetadataProvider::class), + self::createStub(CharsetMetadataProvider::class), + self::createStub(CollationMetadataProvider::class), new DefaultTableOptions('utf8mb4', 'utf8mb4_general_ci'), ); } diff --git a/tests/Platforms/MySQL/ComparatorTest.php b/tests/Platforms/MySQL/ComparatorTest.php index 9c6538b0302..d2d8a25ad21 100644 --- a/tests/Platforms/MySQL/ComparatorTest.php +++ b/tests/Platforms/MySQL/ComparatorTest.php @@ -17,8 +17,8 @@ protected function setUp(): void { $this->comparator = new Comparator( new MySQLPlatform(), - $this->createStub(CharsetMetadataProvider::class), - $this->createStub(CollationMetadataProvider::class), + self::createStub(CharsetMetadataProvider::class), + self::createStub(CollationMetadataProvider::class), new DefaultTableOptions('utf8mb4', 'utf8mb4_general_ci'), ); } diff --git a/tests/Schema/Platforms/MySQLSchemaTest.php b/tests/Schema/Platforms/MySQLSchemaTest.php index 6af64b3b312..fee785069e2 100644 --- a/tests/Schema/Platforms/MySQLSchemaTest.php +++ b/tests/Schema/Platforms/MySQLSchemaTest.php @@ -68,8 +68,8 @@ private function createComparator(): Comparator { return new MySQL\Comparator( new MySQLPlatform(), - $this->createStub(CharsetMetadataProvider::class), - $this->createStub(CollationMetadataProvider::class), + self::createStub(CharsetMetadataProvider::class), + self::createStub(CollationMetadataProvider::class), new DefaultTableOptions('utf8mb4', 'utf8mb4_general_ci'), ); }