Skip to content

Commit

Permalink
Merge branch '5.4' into 6.2
Browse files Browse the repository at this point in the history
* 5.4:
  [Translation][Mailer] Convert `$this` calls to static ones in data providers
  [BC Break] Make data providers for abstract test cases static
  use TestCase suffix for abstract tests in Tests directories
  Fix Request locale property doc types
  Bump absolute lowest dep to 4.4
  • Loading branch information
nicolas-grekas committed Feb 17, 2023
2 parents 8d7daad + 535d93f commit 0612356
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Tests/Constraints/EmailValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function testValidInLooseModeEmails($email)
$this->assertNoViolation();
}

public function getEmailsOnlyValidInLooseMode()
public static function getEmailsOnlyValidInLooseMode()
{
return [
['[email protected]'],
Expand Down Expand Up @@ -137,7 +137,7 @@ public function testValidNormalizedEmailsInLooseMode($email)
$this->assertNoViolation();
}

public function getEmailsWithWhitespacesOnlyValidInLooseMode()
public static function getEmailsWithWhitespacesOnlyValidInLooseMode()
{
return [
["\x09\x09[email protected]\x09\x09"],
Expand Down Expand Up @@ -252,7 +252,7 @@ public function testInvalidAllowNoTldEmails($email)
->assertRaised();
}

public function getInvalidAllowNoTldEmails()
public static function getInvalidAllowNoTldEmails()
{
return [
['example bar'],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Constraints/FileValidatorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ public function testExtensionValid(string $name)
$this->assertNoViolation();
}

private function validExtensionProvider(): iterable
private static function validExtensionProvider(): iterable
{
yield ['test.gif'];
yield ['test.png.gif'];
Expand Down Expand Up @@ -582,7 +582,7 @@ public function testExtensionInvalid(string $name, string $extension)
->assertRaised();
}

private function invalidExtensionProvider(): iterable
private static function invalidExtensionProvider(): iterable
{
yield ['test.gif', 'gif'];
yield ['test.png.gif', 'gif'];
Expand Down
2 changes: 1 addition & 1 deletion Tests/Constraints/ImageValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ public function testInvalidMimeTypeWithNarrowedSet(Image $constraint)
->assertRaised();
}

public function provideInvalidMimeTypeWithNarrowedSet()
public static function provideInvalidMimeTypeWithNarrowedSet()
{
yield 'Doctrine style' => [new Image([
'mimeTypes' => [
Expand Down
10 changes: 5 additions & 5 deletions Tests/Constraints/UniqueValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testValidValues($value)
$this->assertNoViolation();
}

public function getValidValues()
public static function getValidValues()
{
return [
yield 'null' => [[null]],
Expand Down Expand Up @@ -73,7 +73,7 @@ public function testInvalidValues($value)
->assertRaised();
}

public function getInvalidValues()
public static function getInvalidValues()
{
$object = new \stdClass();

Expand Down Expand Up @@ -154,7 +154,7 @@ public function testExpectsNonUniqueObjects($callback)
->assertRaised();
}

public function getCallback(): array
public static function getCallback(): array
{
return [
'static function' => [static function (\stdClass $object) {
Expand Down Expand Up @@ -241,7 +241,7 @@ public function testCollectionFieldNamesMustBeString(string $type, mixed $field)
$this->validator->validate([['value' => 5], ['id' => 1, 'value' => 6]], new Unique(fields: [$field]));
}

public function getInvalidFieldNames(): array
public static function getInvalidFieldNames(): array
{
return [
['stdClass', new \stdClass()],
Expand All @@ -265,7 +265,7 @@ public function testInvalidCollectionValues(array $value, array $fields)
->assertRaised();
}

public function getInvalidCollectionValues(): array
public static function getInvalidCollectionValues(): array
{
return [
'unique string' => [[
Expand Down

0 comments on commit 0612356

Please sign in to comment.