| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function testSerialization(): void |
||
| 29 | { |
||
| 30 | if (!class_exists($this->testedClass)) { |
||
| 31 | $this->markTestSkipped( |
||
| 32 | 'Unable to run ' . self::class . '::testSerialization(). Please set ' . self::class |
||
| 33 | . ':$testedClass to a class-string representing the XML-class being tested', |
||
| 34 | ); |
||
| 35 | } elseif (empty($this->xmlRepresentation)) { |
||
| 36 | $this->markTestSkipped( |
||
| 37 | 'Unable to run ' . self::class . '::testSerialization(). Please set ' . self::class |
||
| 38 | . ':$xmlRepresentation to a DOMDocument representing the XML-class being tested', |
||
| 39 | ); |
||
| 40 | } else { |
||
| 41 | /** @psalm-var \DOMElement */ |
||
| 42 | $xmlRepresentationDocument = $this->xmlRepresentation->documentElement; |
||
| 43 | $this->assertEquals( |
||
| 44 | $this->xmlRepresentation->saveXML($xmlRepresentationDocument), |
||
| 45 | strval(unserialize(serialize($this->testedClass::fromXML($xmlRepresentationDocument)))), |
||
| 46 | ); |
||
| 50 |