From c0bf12ec7ec2b19c035b7017a5f07b2313dfd817 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Dadashi Date: Tue, 15 Aug 2023 18:36:13 +0330 Subject: [PATCH] chore: run `cs-fix` by latest version --- tests/Unit/FilterInCliTest.php | 5 ++--- tests/Unit/NothingPersonalValidatorTest.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/Unit/FilterInCliTest.php b/tests/Unit/FilterInCliTest.php index dd96fc09a..fa9a7c77d 100644 --- a/tests/Unit/FilterInCliTest.php +++ b/tests/Unit/FilterInCliTest.php @@ -10,7 +10,6 @@ use CodeIgniter\Shield\Filters\ChainAuth; use CodeIgniter\Shield\Filters\SessionAuth; use CodeIgniter\Shield\Filters\TokenAuth; -use Generator; use Tests\Support\TestCase; /** @@ -19,7 +18,7 @@ final class FilterInCliTest extends TestCase { /** - * @dataProvider filterProvider + * @dataProvider provideWhenInCliDoNothing */ public function testWhenInCliDoNothing(FilterInterface $filter): void { @@ -31,7 +30,7 @@ public function testWhenInCliDoNothing(FilterInterface $filter): void $filter->before($clirequest); } - public static function filterProvider(): Generator + public static function provideWhenInCliDoNothing(): iterable { yield from [ [new AuthRates()], diff --git a/tests/Unit/NothingPersonalValidatorTest.php b/tests/Unit/NothingPersonalValidatorTest.php index a0d3848d5..b3e7d8e77 100644 --- a/tests/Unit/NothingPersonalValidatorTest.php +++ b/tests/Unit/NothingPersonalValidatorTest.php @@ -158,7 +158,7 @@ public function testFalseForSensibleMatch(): void * * $config->maxSimilarity = 50; is the highest setting where all tests pass. * - * @dataProvider passwordProvider + * @dataProvider provideIsNotPersonalFalsePositivesCaughtByIsNotSimilar * * @param mixed $password */ @@ -180,7 +180,7 @@ public function testIsNotPersonalFalsePositivesCaughtByIsNotSimilar($password): $this->assertNotSame($isNotPersonal, $isNotSimilar); } - public static function passwordProvider(): array + public static function provideIsNotPersonalFalsePositivesCaughtByIsNotSimilar(): iterable { return [ ['JoeTheCaptain'], @@ -195,7 +195,7 @@ public static function passwordProvider(): array } /** - * @dataProvider firstLastNameProvider + * @dataProvider provideConfigPersonalFieldsValues * * @param mixed $firstName * @param mixed $lastName @@ -225,7 +225,7 @@ public function testConfigPersonalFieldsValues($firstName, $lastName, $expected) $this->assertSame($expected, $result->isOK()); } - public static function firstLastNameProvider() + public static function provideConfigPersonalFieldsValues(): iterable { return [ [ @@ -247,7 +247,7 @@ public static function firstLastNameProvider() } /** - * @dataProvider maxSimilarityProvider + * @dataProvider provideMaxSimilarityZeroTurnsOffSimilarityCalculation * * The calculated similarity of 'captnjoe' and 'CaptainJoe' is 88.89. * With $config->maxSimilarity = 66; the password should be rejected, @@ -275,7 +275,7 @@ public function testMaxSimilarityZeroTurnsOffSimilarityCalculation($maxSimilarit $this->assertSame($expected, $result->isOK()); } - public static function maxSimilarityProvider() + public static function provideMaxSimilarityZeroTurnsOffSimilarityCalculation(): iterable { return [ [ @@ -289,7 +289,7 @@ public static function maxSimilarityProvider() } /** - * @dataProvider badEmailsProvider + * @dataProvider provideCheckPasswordWithBadEmail */ public function testCheckPasswordWithBadEmail(string $email, bool $expected): void { @@ -308,7 +308,7 @@ public function testCheckPasswordWithBadEmail(string $email, bool $expected): vo $this->assertSame($expected, $result->isOK()); } - public static function badEmailsProvider() + public static function provideCheckPasswordWithBadEmail(): iterable { return [ [