Commit 9ac208d4 authored by Fabien Potencier's avatar Fabien Potencier

merged branch loalf/validator-tests (PR #230)

Commits
-------

8d9bb8fb Added tests for Validator Provider
291bac8d Added Validator Component as submodule

Discussion
----------

Added tests for Validator Provider

I also had to add the Validator Component as a submodule
parents e9b5d444 8d9bb8fb
......@@ -43,3 +43,6 @@
[submodule "vendor/doctrine-dbal"]
path = vendor/doctrine-dbal
url = https://github.com/doctrine/dbal
[submodule "vendor/Symfony/Component/Validator"]
path = vendor/Symfony/Component/Validator
url = https://github.com/symfony/Validator.git
<?php
/*
* This file is part of the Silex framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Silex\Tests\Provider;
use Silex\Application;
use Silex\Provider\ValidatorServiceProvider;
/**
* ValidatorServiceProvider
*
* Javier Lopez <f12loalf@gmail.com>
*/
class ValidatorServiceProviderTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!is_dir(__DIR__.'/../../../../vendor/Symfony/Component/Validator')) {
$this->markTestSkipped('Validator submodule was not installed.');
}
}
public function testRegister()
{
$app = new Application();
$app->register(new ValidatorServiceProvider(), array(
'validator.class_path' => __DIR__.'/../../../../vendor/Symfony/Component/Validator'
));
return $app;
}
/**
* @depends testRegister
*/
public function testValidatorServiceIsAValidator($app)
{
$this->assertInstanceOf('Symfony\Component\Validator\Validator', $app['validator']);
}
}
Subproject commit 192432f92186a7d0b0a6267787a0dcb00ca5b01b
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment