-
Notifications
You must be signed in to change notification settings - Fork 137
added test for InlineValidator #294
added test for InlineValidator #294
Conversation
eb36a8c
to
315cac9
Compare
|
||
public function testGetErrorElement() | ||
{ | ||
$inlineValidator = new InlineValidator($this->container, $this->constraintValidatorFactory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mother of god… do all classes depend on the container or what? T___T
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mother of god… do all classes depend on the container or what? T___T
😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should have been done with tagged services or something like that…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but please lets do this in another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but please lets do this in another PR
Sure goes without saying, this is more a call to action…
5d43e76
to
e7e48ed
Compare
use Sonata\CoreBundle\Validator\ErrorElement; | ||
|
||
/** | ||
* Class FooValidatorService. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been created automaticaly by the IDE. I will change it ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I think we have the same. 👍
You can change it on settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed the comment.
7e07d22
to
5bb5284
Compare
{ | ||
$this->setExpectedException('Symfony\Component\Validator\Exception\ValidatorException', 'foo is equal to foo'); | ||
|
||
$constraint = $this->getMock('Symfony\Component\Validator\Constraint', array('isClosure', 'getClosure')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getMock
is deprecated in favor of createMock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but createMock
is not available under PHPUnit 4. So let it as is for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right… nevermind, then.
This PR is ready from my side. Anything I should change? |
* | ||
* @author Ahmet Akbana <[email protected]> | ||
*/ | ||
class FooValidatorService |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
5bb5284
to
8c0c0c3
Compare
use Symfony\Component\Validator\Exception\ValidatorException; | ||
|
||
/** | ||
* Test for InlineValidator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me this comment is useless.
By class InlineValidatorTest
, we know this class is to test InlineValidator
. 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
8c0c0c3
to
56c83eb
Compare
RTM. Thank you @ahmetakbn! 👍 |
Good job @ahmetakbn ! |
Subject
Test to increase code coverage of
SonataCoreBundle