Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

added test for InlineValidator #294

Merged

Conversation

codebach
Copy link
Contributor

@codebach codebach commented Jun 7, 2016

Subject

Test to increase code coverage of SonataCoreBundle

@codebach codebach force-pushed the test-for-sonata-core-bundle branch from eb36a8c to 315cac9 Compare June 7, 2016 14:31

public function testGetErrorElement()
{
$inlineValidator = new InlineValidator($this->container, $this->constraintValidatorFactory);
Copy link
Contributor

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

Copy link
Member

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

😆

Copy link
Contributor

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…

Copy link
Member

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

Copy link
Contributor

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…

@codebach codebach force-pushed the test-for-sonata-core-bundle branch 2 times, most recently from 5d43e76 to e7e48ed Compare June 7, 2016 14:41
use Sonata\CoreBundle\Validator\ErrorElement;

/**
* Class FooValidatorService.
Copy link
Member

Choose a reason for hiding this comment

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

Useless comment.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

@codebach codebach force-pushed the test-for-sonata-core-bundle branch 4 times, most recently from 7e07d22 to 5bb5284 Compare June 8, 2016 08:31
{
$this->setExpectedException('Symfony\Component\Validator\Exception\ValidatorException', 'foo is equal to foo');

$constraint = $this->getMock('Symfony\Component\Validator\Constraint', array('isClosure', 'getClosure'));
Copy link
Contributor

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

Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, right… nevermind, then.

@codebach
Copy link
Contributor Author

codebach commented Jun 8, 2016

This PR is ready from my side. Anything I should change?

*
* @author Ahmet Akbana <[email protected]>
*/
class FooValidatorService
Copy link
Member

Choose a reason for hiding this comment

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

final

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

use Symfony\Component\Validator\Exception\ValidatorException;

/**
* Test for InlineValidator.
Copy link
Member

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. 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@codebach codebach force-pushed the test-for-sonata-core-bundle branch from 8c0c0c3 to 56c83eb Compare June 8, 2016 15:05
@soullivaneuh
Copy link
Member

RTM. Thank you @ahmetakbn! 👍

@soullivaneuh soullivaneuh merged commit bf4017b into sonata-project:3.x Jun 9, 2016
@OskarStark
Copy link
Member

Good job @ahmetakbn !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants