Skip to content

Commit

Permalink
fixed #12
Browse files Browse the repository at this point in the history
  • Loading branch information
mathielen committed Jun 6, 2016
1 parent f6e7c1e commit 9a8106e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DependencyInjection/MathielenImportEngineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ private function generateValidationDef(array $validationConfig, Definition $impo
foreach ($validationConfig['source']['constraints'] as $field => $constraint) {
$validationDef->addMethodCall('addSourceConstraint', array(
$field,
new Definition($constraint),
new Reference($constraint),
));
}
}
Expand All @@ -256,7 +256,7 @@ private function generateValidationDef(array $validationConfig, Definition $impo
foreach ($validationConfig['target']['constraints'] as $field => $constraint) {
$validationDef->addMethodCall('addTargetConstraint', array(
$field,
new Definition($constraint),
new Reference($constraint),
));
}
}
Expand Down
6 changes: 6 additions & 0 deletions Tests/DependencyInjection/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Mathielen\ImportEngineBundle\DependencyInjection\MathielenImportEngineExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Url;

abstract class AbstractTest extends \PHPUnit_Framework_TestCase
{
Expand All @@ -29,6 +32,9 @@ protected function setUp()
$this->container->set('logger', $this->getMock('Psr\Log\LoggerInterface'));
$this->container->set('some.converter.serviceid', new MyDummyService());
$this->container->set('some.other.converter.serviceid', new MyDummyService());
$this->container->set('email', new Email());
$this->container->set('url', new Url());
$this->container->set('notempty', new NotBlank());
}
}

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"require-dev": {
"symfony/console": ">=2.2",
"phpunit/phpunit": "*",
"sensio/generator-bundle": "~2.3"
"sensio/generator-bundle": "~2.3",
"symfony/validator": ">=2.2"
},
"suggest": {
"symfony/console": "If you want to use the Commands",
Expand Down

0 comments on commit 9a8106e

Please sign in to comment.