| 1 |
<?php |
| 2 |
declare(strict_types = 1); |
| 3 |
|
| 4 |
namespace DASPRiD\EnumTest; |
| 5 |
|
| 6 |
use DASPRiD\Enum\Exception\CloneNotSupportedException; |
| 7 |
use DASPRiD\Enum\Exception\SerializeNotSupportedException; |
| 8 |
use DASPRiD\Enum\Exception\UnserializeNotSupportedException; |
| 9 |
use DASPRiD\Enum\NullValue; |
| 10 |
use PHPUnit\Framework\TestCase; |
| 11 |
|
| 12 |
final class NullValueTest extends TestCase |
| 13 |
{ |
| 14 |
public function testExceptionOnCloneAttempt() : void |
| 15 |
{ |
| 16 |
$this->expectException(CloneNotSupportedException::class); |
| 17 |
clone NullValue::instance(); |
| 18 |
} |
| 19 |
|
| 20 |
public function testExceptionOnSerializeAttempt() : void |
| 21 |
{ |
| 22 |
$this->expectException(SerializeNotSupportedException::class); |
| 23 |
serialize(NullValue::instance()); |
| 24 |
} |
| 25 |
|
| 26 |
public function testExceptionOnUnserializeAttempt() : void |
| 27 |
{ |
| 28 |
$this->expectException(UnserializeNotSupportedException::class); |
| 29 |
unserialize('O:22:"DASPRiD\\Enum\\NullValue":0:{}'); |
| 30 |
} |
| 31 |
} |