From 3850ef0a930d5bd99abefe5979bd6dfdd5f226df Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Tue, 3 Jan 2017 14:44:53 +0100 Subject: [PATCH] tested expression evaluator --- .../Serializer/Tests/Serializer/BaseSerializationTest.php | 5 +++-- tests/JMS/Serializer/Tests/SerializerBuilderTest.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/JMS/Serializer/Tests/Serializer/BaseSerializationTest.php b/tests/JMS/Serializer/Tests/Serializer/BaseSerializationTest.php index a67969bf2..d8e5d7cd0 100644 --- a/tests/JMS/Serializer/Tests/Serializer/BaseSerializationTest.php +++ b/tests/JMS/Serializer/Tests/Serializer/BaseSerializationTest.php @@ -20,6 +20,7 @@ use JMS\Serializer\Context; use JMS\Serializer\DeserializationContext; +use JMS\Serializer\Expression\ExpressionEvaluator; use JMS\Serializer\GraphNavigator; use JMS\Serializer\Handler\PhpCollectionHandler; use JMS\Serializer\SerializationContext; @@ -215,7 +216,7 @@ public function testExpressionExclusionConfiguredWithDisjunctStrategy() return true; })); - $serializer = new Serializer($this->factory, $this->handlerRegistry, $this->objectConstructor, $this->serializationVisitors, $this->deserializationVisitors, $this->dispatcher, null, $language); + $serializer = new Serializer($this->factory, $this->handlerRegistry, $this->objectConstructor, $this->serializationVisitors, $this->deserializationVisitors, $this->dispatcher, null, new ExpressionEvaluator($language)); $this->assertEquals($this->getContent('person_secret_hide'), $serializer->serialize($person, $this->getFormat())); } @@ -305,7 +306,7 @@ public function testExpressionExclusion($person, ExpressionFunction $function, $ $language = new ExpressionLanguage(); $language->addFunction($function); - $serializer = new Serializer($this->factory, $this->handlerRegistry, $this->objectConstructor, $this->serializationVisitors, $this->deserializationVisitors, $this->dispatcher, null, $language); + $serializer = new Serializer($this->factory, $this->handlerRegistry, $this->objectConstructor, $this->serializationVisitors, $this->deserializationVisitors, $this->dispatcher, null, new ExpressionEvaluator($language)); $this->assertEquals($this->getContent($json), $serializer->serialize($person, $this->getFormat())); } diff --git a/tests/JMS/Serializer/Tests/SerializerBuilderTest.php b/tests/JMS/Serializer/Tests/SerializerBuilderTest.php index c98b9ed1c..70e6826ab 100644 --- a/tests/JMS/Serializer/Tests/SerializerBuilderTest.php +++ b/tests/JMS/Serializer/Tests/SerializerBuilderTest.php @@ -18,6 +18,7 @@ namespace JMS\Serializer\Tests; +use JMS\Serializer\Expression\ExpressionEvaluator; use JMS\Serializer\SerializerBuilder; use JMS\Serializer\Tests\Fixtures\PersonSecret; use Symfony\Component\ExpressionLanguage\ExpressionFunction; @@ -222,7 +223,7 @@ public function testExpressionEngine(ExpressionFunction $function, $json) $language = new ExpressionLanguage(); $language->addFunction($function); - $this->builder->setExpressionLanguage($language); + $this->builder->setExpressionEvaluator(new ExpressionEvaluator($language)); $serializer = $this->builder->build();