Skip to content

Commit

Permalink
Migrate to static data providers using rector/rector
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark authored and nicolas-grekas committed Feb 14, 2023
1 parent fa901e7 commit a307445
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Tests/Command/GenerateUlidCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function testComplete(array $input, array $expectedSuggestions)
$this->assertSame($expectedSuggestions, $suggestions);
}

public function provideCompletionSuggestions(): iterable
public static function provideCompletionSuggestions(): iterable
{
yield 'option --format' => [
['--format', ''],
Expand Down
8 changes: 4 additions & 4 deletions Tests/Command/GenerateUuidCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function testInvalidCombinationOfBasedOptions(array $input)
$this->assertStringContainsString('Only one of "--time-based", "--name-based" or "--random-based"', $commandTester->getDisplay());
}

public function provideInvalidCombinationOfBasedOptions()
public static function provideInvalidCombinationOfBasedOptions()
{
return [
[['--time-based' => 'now', '--name-based' => 'foo']],
Expand All @@ -153,7 +153,7 @@ public function testExtraNodeOption(array $input)
$this->assertStringContainsString('Option "--node" can only be used with "--time-based"', $commandTester->getDisplay());
}

public function provideExtraNodeOption()
public static function provideExtraNodeOption()
{
return [
[['--node' => 'foo']],
Expand All @@ -173,7 +173,7 @@ public function testExtraNamespaceOption(array $input)
$this->assertStringContainsString('Option "--namespace" can only be used with "--name-based"', $commandTester->getDisplay());
}

public function provideExtraNamespaceOption()
public static function provideExtraNamespaceOption()
{
return [
[['--namespace' => 'foo']],
Expand Down Expand Up @@ -248,7 +248,7 @@ public function testComplete(array $input, array $expectedSuggestions)
$this->assertSame($expectedSuggestions, $suggestions);
}

public function provideCompletionSuggestions(): iterable
public static function provideCompletionSuggestions(): iterable
{
yield 'option --format' => [
['--format', ''],
Expand Down
8 changes: 4 additions & 4 deletions Tests/UlidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function testFromBinaryInvalidFormat(string $ulid)
Ulid::fromBinary($ulid);
}

public function provideInvalidBinaryFormat()
public static function provideInvalidBinaryFormat()
{
return [
['01EW2RYKDCT2SAK454KBR2QG08'],
Expand All @@ -176,7 +176,7 @@ public function testFromBase58InvalidFormat(string $ulid)
Ulid::fromBase58($ulid);
}

public function provideInvalidBase58Format()
public static function provideInvalidBase58Format()
{
return [
["\x01\x77\x05\x8F\x4D\xAC\xD0\xB2\xA9\x90\xA4\x9A\xF0\x2B\xC0\x08"],
Expand All @@ -203,7 +203,7 @@ public function testFromBase32InvalidFormat(string $ulid)
Ulid::fromBase32($ulid);
}

public function provideInvalidBase32Format()
public static function provideInvalidBase32Format()
{
return [
["\x01\x77\x05\x8F\x4D\xAC\xD0\xB2\xA9\x90\xA4\x9A\xF0\x2B\xC0\x08"],
Expand All @@ -230,7 +230,7 @@ public function testFromRfc4122InvalidFormat(string $ulid)
Ulid::fromRfc4122($ulid);
}

public function provideInvalidRfc4122Format()
public static function provideInvalidRfc4122Format()
{
return [
["\x01\x77\x05\x8F\x4D\xAC\xD0\xB2\xA9\x90\xA4\x9A\xF0\x2B\xC0\x08"],
Expand Down
14 changes: 7 additions & 7 deletions Tests/UuidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testConstructorWithInvalidUuid(string $uuid)
Uuid::fromString($uuid);
}

public function provideInvalidUuids(): iterable
public static function provideInvalidUuids(): iterable
{
yield ['this is not a uuid'];
yield ['these are just thirty-six characters'];
Expand All @@ -61,7 +61,7 @@ public function testInvalidVariant(string $uuid)
new $class($uuid);
}

public function provideInvalidVariant(): iterable
public static function provideInvalidVariant(): iterable
{
yield ['8dac64d3-937a-1e7c-fa1d-d5d6c06a61f5'];
yield ['8dac64d3-937a-3e7c-fa1d-d5d6c06a61f5'];
Expand Down Expand Up @@ -206,7 +206,7 @@ public function testEqualsAgainstOtherType($other)
$this->assertFalse((new UuidV4(self::A_UUID_V4))->equals($other));
}

public function provideInvalidEqualType()
public static function provideInvalidEqualType()
{
yield [null];
yield [self::A_UUID_V1];
Expand Down Expand Up @@ -268,7 +268,7 @@ public function testFromBinaryInvalidFormat(string $ulid)
Uuid::fromBinary($ulid);
}

public function provideInvalidBinaryFormat()
public static function provideInvalidBinaryFormat()
{
return [
['01EW2RYKDCT2SAK454KBR2QG08'],
Expand All @@ -295,7 +295,7 @@ public function testFromBase58InvalidFormat(string $ulid)
Uuid::fromBase58($ulid);
}

public function provideInvalidBase58Format()
public static function provideInvalidBase58Format()
{
return [
["\x41\x4C\x08\x92\x57\x1B\x11\xEB\xBF\x70\x93\xF9\xB0\x82\x2C\x57"],
Expand All @@ -322,7 +322,7 @@ public function testFromBase32InvalidFormat(string $ulid)
Uuid::fromBase32($ulid);
}

public function provideInvalidBase32Format()
public static function provideInvalidBase32Format()
{
return [
["\x5B\xA8\x32\x72\x45\x6D\x5A\xC0\xAB\xE3\xAA\x8B\xF7\x01\x96\x73"],
Expand All @@ -349,7 +349,7 @@ public function testFromRfc4122InvalidFormat(string $ulid)
Uuid::fromRfc4122($ulid);
}

public function provideInvalidRfc4122Format()
public static function provideInvalidRfc4122Format()
{
return [
["\x1E\xB5\x71\xB4\x14\xC0\x68\x93\xBF\x70\x2D\x4C\x83\xCF\x75\x5A"],
Expand Down

0 comments on commit a307445

Please sign in to comment.