Update tests to work with PHPUnit 10

This commit is contained in:
Zach Borboa
2023-02-16 05:58:35 -08:00
parent acf5443a68
commit 4ed7644250
12 changed files with 68 additions and 20 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php declare(strict_types=1);
namespace Helper;
// Check interface exists to fix "Fatal error: Interface 'JsonSerializable' not found in ../tests/PHPCurlClass/User.php
// on line X".
if (interface_exists('JsonSerializable')) {
class User implements \JsonSerializable
{
private $name;
private $email;
public function __construct($name = null, $email = null)
{
$this->name = $name;
$this->email = $email;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [
'name' => $this->name,
'email' => $this->email,
];
}
}
}