Skip to content

Commit

Permalink
tested expression evaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
goetas committed Jan 3, 2017
1 parent 072aec3 commit 3850ef0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()));
}
Expand Down Expand Up @@ -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()));
}

Expand Down
3 changes: 2 additions & 1 deletion tests/JMS/Serializer/Tests/SerializerBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 3850ef0

Please sign in to comment.