Commit 59acb2da authored by Anton Smirnov's avatar Anton Smirnov
Browse files

Different method in the old PHPUnit

parent 27152091
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -91,10 +91,17 @@ class SerializeTest extends TestCase
            $randomizer2 = unserialize(@serialize($randomizer));
        } catch (Throwable $e) {
            self::assertEquals(\Exception::class, get_class($e));
            if (method_exists(__CLASS__, 'assertMatchesRegularExpression')) {
                self::assertMatchesRegularExpression(
                    "/Serialization of '.*@anonymous' is not allowed/",
                    $e->getMessage()
                );
            } else {
                self::assertRegExp(
                    "/Serialization of '.*@anonymous' is not allowed/",
                    $e->getMessage()
                );
            }
            self::assertEquals(0, $e->getCode());
            self::assertNull($e->getPrevious());