From cc13ab59f4a5160d10165efbad4079cee7a8d7d3 Mon Sep 17 00:00:00 2001 From: SonataCI Date: Wed, 13 Nov 2024 10:51:17 +0000 Subject: [PATCH 1/3] DevKit updates --- rector.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rector.php b/rector.php index b6dac16fc..744632387 100644 --- a/rector.php +++ b/rector.php @@ -19,6 +19,7 @@ use Rector\Config\RectorConfig; use Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector; +use Rector\PHPUnit\CodeQuality\Rector\Class_\NarrowUnusedSetUpDefinedPropertyRector; use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector; use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Set\ValueObject\LevelSetList; @@ -40,5 +41,6 @@ $rectorConfig->skip([ ExceptionHandlerTypehintRector::class, PreferPHPUnitThisCallRector::class, + NarrowUnusedSetUpDefinedPropertyRector::class, ]); }; From b1d941c03e36f57538ece817008153e87368cb29 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Wed, 13 Nov 2024 14:44:11 +0100 Subject: [PATCH 2/3] Fix tests --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index d2271c8a9..310d2a299 100644 --- a/composer.json +++ b/composer.json @@ -55,6 +55,7 @@ "matthiasnoback/symfony-config-test": "^4.2 || ^5.0", "matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0", "phpstan/extension-installer": "^1.0", + "phpstan/phpdoc-parser": "^1.0", "phpstan/phpstan": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1.0", From e990b8d00203784c1d8c6a403cd0ac398e585bd1 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Wed, 13 Nov 2024 14:52:23 +0100 Subject: [PATCH 3/3] Rector --- tests/Functional/Action/ResetActionTest.php | 6 +++--- tests/Functional/Command/ChangePasswordCommandTest.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Functional/Action/ResetActionTest.php b/tests/Functional/Action/ResetActionTest.php index f3a556d48..b56b655d5 100644 --- a/tests/Functional/Action/ResetActionTest.php +++ b/tests/Functional/Action/ResetActionTest.php @@ -37,7 +37,7 @@ public function testItSubmitsResetPasswordFormWithNonValidData(): void $confirmationToken = $user->getConfirmationToken(); \assert(null !== $confirmationToken); - static::assertSame($user->getPassword(), 'random_password'); + static::assertSame('random_password', $user->getPassword()); $client->request('GET', \sprintf('/reset/%s', $confirmationToken)); @@ -60,7 +60,7 @@ public function testItResetsPassword(): void $confirmationToken = $user->getConfirmationToken(); \assert(null !== $confirmationToken); - static::assertSame($user->getPassword(), 'random_password'); + static::assertSame('random_password', $user->getPassword()); $client->request('GET', \sprintf('/reset/%s', $confirmationToken)); @@ -76,7 +76,7 @@ public function testItResetsPassword(): void static::assertNull($user->getPasswordRequestedAt()); static::assertNull($user->getConfirmationToken()); - static::assertSame($user->getPassword(), 'new_password'); + static::assertSame('new_password', $user->getPassword()); } private function prepareData(): UserInterface diff --git a/tests/Functional/Command/ChangePasswordCommandTest.php b/tests/Functional/Command/ChangePasswordCommandTest.php index ded6fc6a2..10ef9a27b 100644 --- a/tests/Functional/Command/ChangePasswordCommandTest.php +++ b/tests/Functional/Command/ChangePasswordCommandTest.php @@ -47,7 +47,7 @@ public function testChangesUserPassword(): void { $user = $this->prepareData('sonata-user-test', 'old_password'); - static::assertSame($user->getPassword(), 'old_password'); + static::assertSame('old_password', $user->getPassword()); $this->commandTester->execute([ 'username' => 'sonata-user-test', @@ -56,7 +56,7 @@ public function testChangesUserPassword(): void $user = $this->refreshUser($user); - static::assertSame($user->getPassword(), 'new_password'); + static::assertSame('new_password', $user->getPassword()); static::assertStringContainsString('Changed password for user "sonata-user-test".', $this->commandTester->getDisplay()); }