Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ExpressionLanguage] optimized serialization of nodes and expressions
- Loading branch information
1 parent
60b9f85
commit 5076ec7
Showing
6 changed files
with
69 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/Symfony/Component/ExpressionLanguage/Tests/ExpressionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\ExpressionLanguage\Tests; | ||
|
||
use Symfony\Component\ExpressionLanguage\Expression; | ||
|
||
class ExpressionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testSerialization() | ||
{ | ||
$expression = new Expression('kernel.boot()'); | ||
|
||
$serializedExpression = serialize($expression); | ||
$unserializedExpression = unserialize($serializedExpression); | ||
|
||
$this->assertEquals($expression, $unserializedExpression); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/Symfony/Component/ExpressionLanguage/Tests/ParsedExpressionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\ExpressionLanguage\Tests; | ||
|
||
use Symfony\Component\ExpressionLanguage\Node\ConstantNode; | ||
use Symfony\Component\ExpressionLanguage\ParsedExpression; | ||
|
||
class ParsedExpressionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testSerialization() | ||
{ | ||
$expression = new ParsedExpression('25', new ConstantNode('25')); | ||
|
||
$serializedExpression = serialize($expression); | ||
$unserializedExpression = unserialize($serializedExpression); | ||
|
||
$this->assertEquals($expression, $unserializedExpression); | ||
} | ||
} |