Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: fix coding style error #787

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions tests/Unit/FilterInCliTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -19,7 +18,7 @@
final class FilterInCliTest extends TestCase
{
/**
* @dataProvider filterProvider
* @dataProvider provideWhenInCliDoNothing
*/
public function testWhenInCliDoNothing(FilterInterface $filter): void
{
Expand All @@ -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()],
Expand Down
16 changes: 8 additions & 8 deletions tests/Unit/NothingPersonalValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -180,7 +180,7 @@ public function testIsNotPersonalFalsePositivesCaughtByIsNotSimilar($password):
$this->assertNotSame($isNotPersonal, $isNotSimilar);
}

public static function passwordProvider(): array
public static function provideIsNotPersonalFalsePositivesCaughtByIsNotSimilar(): iterable
{
return [
['JoeTheCaptain'],
Expand All @@ -195,7 +195,7 @@ public static function passwordProvider(): array
}

/**
* @dataProvider firstLastNameProvider
* @dataProvider provideConfigPersonalFieldsValues
*
* @param mixed $firstName
* @param mixed $lastName
Expand Down Expand Up @@ -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 [
[
Expand All @@ -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,
Expand Down Expand Up @@ -275,7 +275,7 @@ public function testMaxSimilarityZeroTurnsOffSimilarityCalculation($maxSimilarit
$this->assertSame($expected, $result->isOK());
}

public static function maxSimilarityProvider()
public static function provideMaxSimilarityZeroTurnsOffSimilarityCalculation(): iterable
{
return [
[
Expand All @@ -289,7 +289,7 @@ public static function maxSimilarityProvider()
}

/**
* @dataProvider badEmailsProvider
* @dataProvider provideCheckPasswordWithBadEmail
*/
public function testCheckPasswordWithBadEmail(string $email, bool $expected): void
{
Expand All @@ -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 [
[
Expand Down
Loading