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:
  Migrate to `static` data providers using `rector/rector`
  • Loading branch information
nicolas-grekas committed Feb 14, 2023
2 parents d1347f0 + 3c2942a commit e27ea15
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Tests/Caster/CasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function testFilter($filter, $expectedDiff, $listedProperties = null)
$this->assertSame($expectedDiff, array_diff_assoc(self::$referenceArray, $filteredArray));
}

public function provideFilter()
public static function provideFilter()
{
return [
[
Expand Down
8 changes: 4 additions & 4 deletions Tests/Caster/DateCasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testCastDateTime($time, $timezone, $xDate, $xTimestamp, $xInfos)
$this->assertDumpMatchesFormat($xDump, $cast["\0~\0date"]);
}

public function provideDateTimes()
public static function provideDateTimes()
{
return [
['2017-04-30 00:00:00.000000', 'Europe/Zurich', '2017-04-30 00:00:00.0 Europe/Zurich (+02:00)', 1493503200, 'Sunday, April 30, 2017%Afrom now%ADST On'],
Expand Down Expand Up @@ -210,7 +210,7 @@ public function testCastInterval($intervalSpec, $ms, $invert, $xInterval, $xSeco
$this->assertDumpMatchesFormat($xDump, $cast["\0~\0interval"]);
}

public function provideIntervals()
public static function provideIntervals()
{
return [
['PT0S', 0, 0, '0s', '0s'],
Expand Down Expand Up @@ -309,7 +309,7 @@ public function testCastTimeZone($timezone, $xTimezone, $xRegion)
$this->assertDumpMatchesFormat($xDump, $cast["\0~\0timezone"]);
}

public function provideTimeZones()
public static function provideTimeZones()
{
$xRegion = \extension_loaded('intl') ? '%s' : '';

Expand Down Expand Up @@ -386,7 +386,7 @@ public function testCastPeriod($start, $interval, $end, $options, $xPeriod, $xDa
$this->assertDumpMatchesFormat($xDump, $cast["\0~\0period"]);
}

public function providePeriods()
public static function providePeriods()
{
$periods = [
['2017-01-01', 'P1D', '2017-01-03', 0, 'every + 1d, from [2017-01-01 00:00:00.0 to 2017-01-03 00:00:00.0[', '1) 2017-01-01%a2) 2017-01-02'],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Caster/SplCasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SplCasterTest extends TestCase
{
use VarDumperTestTrait;

public function getCastFileInfoTests()
public static function getCastFileInfoTests()
{
return [
[__FILE__, <<<'EOTXT'
Expand Down Expand Up @@ -135,7 +135,7 @@ public function testCastSplDoublyLinkedList($modeValue, $modeDump)
$this->assertDumpMatchesFormat($dump, $var);
}

public function provideCastSplDoublyLinkedList()
public static function provideCastSplDoublyLinkedList()
{
return [
[\SplDoublyLinkedList::IT_MODE_FIFO, 'IT_MODE_FIFO | IT_MODE_KEEP'],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Caster/XmlReaderCasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testNodes($seek, $expectedDump)
$this->assertDumpMatchesFormat($expectedDump, $this->reader);
}

public function provideNodes()
public static function provideNodes()
{
return [
[0, <<<'EODUMP'
Expand Down
2 changes: 1 addition & 1 deletion Tests/Command/Descriptor/CliDescriptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testDescribe(array $context, string $expectedOutput, bool $decor
$this->assertStringMatchesFormat(trim($expectedOutput), str_replace(\PHP_EOL, "\n", trim($output->fetch())));
}

public function provideContext()
public static function provideContext()
{
yield 'source' => [
[
Expand Down
2 changes: 1 addition & 1 deletion Tests/Command/Descriptor/HtmlDescriptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testDescribe(array $context, string $expectedOutput)
$this->assertStringMatchesFormat(trim($expectedOutput), trim(preg_replace('@<style>.*</style><script>.*</script>@s', '', $output->fetch())));
}

public function provideContext()
public static function provideContext()
{
yield 'source' => [
[
Expand Down
2 changes: 1 addition & 1 deletion Tests/Command/ServerDumpCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testComplete(array $input, array $expectedSuggestions)
$this->assertSame($expectedSuggestions, $tester->complete($input));
}

public function provideCompletionSuggestions()
public static function provideCompletionSuggestions()
{
yield 'option --format' => [
['--format', ''],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Dumper/CliDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function testDumpWithCommaFlagsAndExceptionCodeExcerpt()
, $dump);
}

public function provideDumpWithCommaFlagTests()
public static function provideDumpWithCommaFlagTests()
{
$expected = <<<'EOTXT'
array:3 [
Expand Down Expand Up @@ -398,7 +398,7 @@ public function testIncompleteClass()
);
}

public function provideDumpArrayWithColor()
public static function provideDumpArrayWithColor()
{
yield [
['foo' => 'bar'],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Dumper/HtmlDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function testDumpString($var, $needle)
$this->assertStringContainsString($needle, $out);
}

public function varToDumpProvider()
public static function varToDumpProvider()
{
return [
[['dummy' => new ImgStub('dummy', 'img/png', '100em')], '<img src="data:img/png;base64,ZHVtbXk=" />'],
Expand Down

0 comments on commit e27ea15

Please sign in to comment.