public function RouteTest::testSerializeWhenCompiled in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/routing/Tests/RouteTest.php \Symfony\Component\Routing\Tests\RouteTest::testSerializeWhenCompiled()
Tests that the compiled version is also serialized to prevent the overhead of compiling it again after unserialize.
File
- vendor/
symfony/ routing/ Tests/ RouteTest.php, line 254
Class
Namespace
Symfony\Component\Routing\TestsCode
public function testSerializeWhenCompiled() {
$route = new Route('/prefix/{foo}', array(
'foo' => 'default',
), array(
'foo' => '\\d+',
));
$route
->setHost('{locale}.example.net');
$route
->compile();
$serialized = serialize($route);
$unserialized = unserialize($serialized);
$this
->assertEquals($route, $unserialized);
$this
->assertNotSame($route, $unserialized);
}