From 2c189141769f8eef7a345d4756b8f6106df2f062 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 12 Oct 2023 16:27:31 +0200 Subject: [PATCH] define all dataProvider as static --- tests/Fixtures/HelperTrait.php | 24 ++++++++++++------------ tests/Functional/ParsingTest.php | 2 +- tests/Functional/SerializerTest.php | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/Fixtures/HelperTrait.php b/tests/Fixtures/HelperTrait.php index b404043..e863224 100644 --- a/tests/Fixtures/HelperTrait.php +++ b/tests/Fixtures/HelperTrait.php @@ -33,7 +33,7 @@ trait HelperTrait * * @see http://json.org/ */ - public function jsonValuesProvider() + public static function jsonValuesProvider(): array { return [ [new \stdClass()], @@ -53,9 +53,9 @@ public function jsonValuesProvider() * * @see http://json.org/ */ - public function jsonValuesProviderWithoutObject() + public static function jsonValuesProviderWithoutObject(): array { - $data = $this->jsonValuesProvider(); + $data = static::jsonValuesProvider(); unset($data[0]); @@ -67,9 +67,9 @@ public function jsonValuesProviderWithoutObject() * * @see http://json.org/ */ - public function jsonValuesProviderWithoutArray() + public static function jsonValuesProviderWithoutArray(): array { - $data = $this->jsonValuesProvider(); + $data = static::jsonValuesProvider(); unset($data[1]); @@ -81,9 +81,9 @@ public function jsonValuesProviderWithoutArray() * * @see http://json.org/ */ - public function jsonValuesProviderWithoutString() + public static function jsonValuesProviderWithoutString(): array { - $data = $this->jsonValuesProvider(); + $data = static::jsonValuesProvider(); unset($data[2]); @@ -95,9 +95,9 @@ public function jsonValuesProviderWithoutString() * * @see http://json.org/ */ - public function jsonValuesProviderWithoutObjectAndString() + public static function jsonValuesProviderWithoutObjectAndString(): array { - $data = $this->jsonValuesProvider(); + $data = static::jsonValuesProvider(); unset($data[0]); unset($data[2]); @@ -110,7 +110,7 @@ public function jsonValuesProviderWithoutObjectAndString() * * @see http://json.org/ */ - public function jsonValuesAsStringProvider() + public static function jsonValuesAsStringProvider(): array { return [ ['{}'], @@ -130,9 +130,9 @@ public function jsonValuesAsStringProvider() * * @see http://json.org/ */ - public function jsonValuesAsStringProviderWithoutObject() + public static function jsonValuesAsStringProviderWithoutObject(): array { - $data = $this->jsonValuesAsStringProvider(); + $data = static::jsonValuesAsStringProvider(); unset($data[0]); diff --git a/tests/Functional/ParsingTest.php b/tests/Functional/ParsingTest.php index 85a2e4b..81b44b1 100644 --- a/tests/Functional/ParsingTest.php +++ b/tests/Functional/ParsingTest.php @@ -34,7 +34,7 @@ class ParsingTest extends \Art4\JsonApiClient\Tests\Fixtures\TestCase /** * Provide Parser */ - public function createParserProvider() + public static function createParserProvider(): array { $errorAbortManagerParser = function ($string) { $manager = new ErrorAbortManager(new Factory()); diff --git a/tests/Functional/SerializerTest.php b/tests/Functional/SerializerTest.php index 7010d98..7fbd833 100644 --- a/tests/Functional/SerializerTest.php +++ b/tests/Functional/SerializerTest.php @@ -34,7 +34,7 @@ class SerializerTest extends TestCase /** * Provide JSON API data */ - public function jsonapiDataProvider() + public static function jsonapiDataProvider(): array { $path = str_replace('/', \DIRECTORY_SEPARATOR, __DIR__ . '/../files/'); $files = [];