10000 [Validator] Fix caching of constraints derived from non-serializable parents by uwej711 · Pull Request #20793 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Validator] Fix caching of constraints derived from non-serializable parents #20793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix test for PHP 5.3
  • Loading branch information
uwej711 committed Dec 7, 2016
commit 427cc5cacef0cbef6318b43020179ccf4d413590
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public function testReadMetadataFromCache()
$metadata->addConstraint(new ConstraintA());

$parentClass = self::PARENT_CLASS;
$interfaceClass = self::INTERFACE_A_CLASS;

$loader->expects($this->never())
->method('loadClassMetadata');
Expand All @@ -136,12 +137,12 @@ public function testReadMetadataFromCache()
array(self::PARENT_CLASS),
array(self::INTERFACE_A_CLASS)
)
->willReturnCallback(function ($name) use ($metadata, $parentClass) {
->willReturnCallback(function ($name) use ($metadata, $parentClass, $interfaceClass) {
if ($parentClass == $name) {
return $metadata;
}

return new ClassMetadata(self::INTERFACE_A_CLASS);
return new ClassMetadata($interfaceClass);
});

$this->assertEquals($metadata, $factory->getMetadataFor(self::PARENT_CLASS));
Expand Down
0