Skip to content

Commit

Permalink
Add PHPUnit 11 attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Dec 11, 2024
1 parent 64c9bf9 commit 864b259
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/JsonSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand Down

0 comments on commit 864b259

Please sign in to comment.