Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2e72aa0

Browse filesBrowse files
committed
fix mocks
* check for existance of `setMetadataFactory()` method (this is needed for tests run with deps=high as the method was removed in Symfony 3.0) * fix mock testing the `EngineInterface` as the `stream()` method cannot be mocked when it is does not exist in the mocked interface
1 parent 779e9c9 commit 2e72aa0
Copy full SHA for 2e72aa0

File tree

Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed

‎Tests/Extension/Validator/ValidatorExtensionTest.php

Copy file name to clipboardExpand all lines: Tests/Extension/Validator/ValidatorExtensionTest.php
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Form\Tests\Extension\Validator;
1313

1414
use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
15+
use Symfony\Component\Validator\ValidatorInterface;
1516

1617
class ValidatorExtensionTest extends \PHPUnit_Framework_TestCase
1718
{
@@ -38,9 +39,11 @@ public function test2Dot5ValidationApi()
3839
->method('addPropertyConstraint')
3940
->with('children', $this->isInstanceOf('Symfony\Component\Validator\Constraints\Valid'));
4041

41-
$validator
42-
->expects($this->never())
43-
->method('getMetadataFactory');
42+
if ($validator instanceof ValidatorInterface) {
43+
$validator
44+
->expects($this->never())
45+
->method('getMetadataFactory');
46+
}
4447

4548
$extension = new ValidatorExtension($validator);
4649
$guesser = $extension->loadTypeGuesser();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.