| Total Complexity | 5 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class IgbinarySerializerTest extends TestCase |
||
| 9 | { |
||
| 10 | |||
| 11 | /** @var IgbinarySerializer */ |
||
| 12 | private $SUT; |
||
| 13 | |||
| 14 | private $original; |
||
| 15 | private $igb; |
||
| 16 | |||
| 17 | public function test_serialize() |
||
| 18 | { |
||
| 19 | $this->assertEquals(igbinary_serialize($this->original), $this->SUT->serialize($this->original)); |
||
| 20 | } |
||
| 21 | |||
| 22 | public function test_unserialize() |
||
| 23 | { |
||
| 24 | $this->assertEquals($this->original, $this->SUT->unserialize($this->igb)); |
||
| 25 | } |
||
| 26 | |||
| 27 | public function testName() |
||
| 28 | { |
||
| 29 | $this->assertSame(Serializer::IGBINARY, $this->SUT->type()); |
||
| 30 | } |
||
| 31 | |||
| 32 | protected function setUp(): void |
||
| 33 | { |
||
| 34 | if (false === function_exists('igbinary_serialize')) { |
||
| 35 | $this->markTestSkipped('igbinary extension is not loaded'); |
||
| 36 | } |
||
| 37 | |||
| 38 | $this->SUT = new IgbinarySerializer; |
||
| 39 | $this->original = require __DIR__ . '/../fixtures/config-test.php'; |
||
| 40 | $this->igb = igbinary_serialize($this->original); |
||
| 41 | } |
||
| 43 |