Skip to content

Commit

Permalink
Ignores test for PHP 7.2+
Browse files Browse the repository at this point in the history
The offending test breaks due to a representation change in the
deserialized (incomplete) object and can safely be ignored.
  • Loading branch information
Denis Brumann committed Jul 24, 2020
1 parent 2b3fdcf commit 7eaba94
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/UnserializeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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()
Expand Down

0 comments on commit 7eaba94

Please sign in to comment.