From 864b2599cf62118084bdcf6e485de4abdae761fe Mon Sep 17 00:00:00 2001 From: William Desportes Date: Wed, 11 Dec 2024 02:16:28 +0100 Subject: [PATCH] Add PHPUnit 11 attributes --- tests/JsonSerializerTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/JsonSerializerTest.php b/tests/JsonSerializerTest.php index 6889e17..9642a3a 100644 --- a/tests/JsonSerializerTest.php +++ b/tests/JsonSerializerTest.php @@ -26,6 +26,7 @@ class JsonSerializerTest extends TestCase * @before * @return void */ + #[\PHPUnit\Framework\Attributes\Before] public function setUpSerializer() { $customObjectSerializerMap['Zumba\\JsonSerializer\\Test\\SupportClasses\\MyType'] = new \Zumba\JsonSerializer\Test\SupportClasses\MyTypeSerializer(); @@ -40,6 +41,7 @@ public function setUpSerializer() * @param string $jsoned * @return void */ + #[\PHPUnit\Framework\Attributes\DataProvider('scalarData')] public function testSerializeScalar($scalar, $jsoned) { $this->assertSame($jsoned, $this->serializer->serialize($scalar)); @@ -74,6 +76,7 @@ public function testSerializeFloatLocalized() * @param string $jsoned * @return void */ + #[\PHPUnit\Framework\Attributes\DataProvider('scalarData')] public function testUnserializeScalar($scalar, $jsoned) { $this->assertSame($scalar, $this->serializer->unserialize($jsoned)); @@ -134,6 +137,7 @@ public function testSerializeClosureWithoutSerializer() * @param string $jsoned * @return void */ + #[\PHPUnit\Framework\Attributes\DataProvider('arrayNoObjectData')] public function testSerializeArrayNoObject($array, $jsoned) { $this->assertSame($jsoned, $this->serializer->serialize($array)); @@ -147,6 +151,7 @@ public function testSerializeArrayNoObject($array, $jsoned) * @param string $jsoned * @return void */ + #[\PHPUnit\Framework\Attributes\DataProvider('arrayNoObjectData')] public function testUnserializeArrayNoObject($array, $jsoned) { $this->assertSame($array, $this->serializer->unserialize($jsoned));