8000 [Form] fix tests on old phpunit versions by nicolas-grekas · Pull Request #27338 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] fix tests on old phpunit versions #27338

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

Merged
merged 1 commit into from
May 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
8000 Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Form] fix tests on old phpunit versions
  • Loading branch information
nicolas-grekas committed May 22, 2018
commit 208d1d1306eac1d6d43d385ed0b5ecaf0c24ed47
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function getValidatorExtension()
}

$this->validator = $this->getMockBuilder(ValidatorInterface::class)->getMock();
$metadata = $this->getMockBuilder(ClassMetadata::class)->disableOriginalConstructor()->getMock();
$metadata = $this->getMockBuilder(ClassMetadata::class)->disableOriginalConstructor()->setMethods(array('addPropertyConstraint'))->getMock();
$this->validator->expects($this->any())->method('getMetadataFor')->will($this->returnValue($metadata));
$this->validator->expects($this->any())->method('validate')->will($this->returnValue(array()));
8000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function test2Dot5ValidationApi()
->disableOriginalConstructor()
->getMock();
$metadata = $this->getMockBuilder('Symfony\Component\Validator\Mapping\ClassMetadata')
->setMethods(array('addConstraint', 'addPropertyConstraint'))
->disableOriginalConstructor()
->getMock();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ public function getMaxDepth();
/**
* Merges an {@see AttributeMetadataInterface} with in the current one.
*/
public function merge(self $attributeMetadata);
public function merge(AttributeMetadataInterface $attributeMetadata);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the issue with this change is that PHP-CS-Fixer will revert it on any run.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, but we look at tests before merging, don't we? :)

}
0