Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Fix adding custom extensions for unit testing#6463

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@jacek-foremski
Copy link

QA
Doc fix?yes
New docs?no
Applies toall
Fixed tickets-

The previous version was generating the following error when running tests:

Error: Call to a member function addConstraint() on null

/vagrant/blog/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php:39
/vagrant/blog/tests/AppBundle/Form/Type/UserCreateTypeTest.php:87
/vagrant/blog/vendor/symfony/symfony/src/Symfony/Component/Form/Test/FormIntegrationTestCase.php:30
/vagrant/blog/vendor/symfony/symfony/src/Symfony/Component/Form/Test/TypeTestCase.php:31
/vagrant/blog/tests/AppBundle/Form/Type/UserCreateTypeTest.php:93

The changes for vesion 2.8+ should be a little different due to the refactoring that took place, but I would be happy to fix it once this gets merged.

@xabbuh
Copy link
Member

I am not sure if it wasn't better to properly set up the validator extension here instead of mocking things away.

@xabbuh
Copy link
Member

What do others think about this?

->getMock();
$validator
->method('getMetadataFor')
->will($this->returnValue($metadata));
Copy link
Contributor

Choose a reason for hiding this comment

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

Could actually be->willReturn($metadata);

@xabbuh
Copy link
Member

Sorry@natanael89 for not merging your PR earlier. Unfortunately, we merged#7941 in the meantime so there's no need for this PR anymore. I hope to see you soon again with some other changes though.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@linaorilinaorilinaori left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@jacek-foremski@xabbuh@linaori@javiereguiluz

[8]ページ先頭

©2009-2025 Movatter.jp