diff --git a/tests/UnserializeTest.php b/tests/UnserializeTest.php index e9adfb3..031456f 100644 --- a/tests/UnserializeTest.php +++ b/tests/UnserializeTest.php @@ -232,6 +232,26 @@ public function test_double_unserialize_double_serialized() $this->assertInstanceOf('__PHP_Incomplete_Class', $unserialized); } + /** + * @requires PHP < 7.2 + * + * In PHP 7.2+ the unserialized, incomplete object is not a stdClass object. + * + * That means instead of: + * + * stdClass Object &000000007bdb046700000000047a45c3 ( + * 'value' => 'a:2:{i:0;s:4:"item";i:1;O:8:"stdClass":1:{s:5:"value";s:12:"s:5:"inner";";}}' + * ) + * + * We get: + * + * __PHP_Incomplete_Class Object &000000007bdb047d00000000047a45c3 ( + * '__PHP_Incomplete_Class_Name' => 'stdClass' + * 'value' => 'a:2:{i:0;s:4:"item";i:1;O:8:"stdClass":1:{s:5:"value";s:12:"s:5:"inner";";}}' + * ) + * + * We do not care about this changed representation and ignore this test instead for these versions. + */ public function test_nested_serialized_object_in_serialized_object_can_be_deserialized() { $inner = new \stdClass(); @@ -243,7 +263,7 @@ public function test_nested_serialized_object_in_serialized_object_can_be_deseri $unserialized = Unserialize::unserialize($serialized, $options); - $this->assertEquals($outer,$unserialized); + $this->assertEquals($outer, $unserialized); } public function test_string_containing_serialized_literals_can_be_deserialized()