Skip to content
Browse files

Added tests for Validator Provider

  • Loading branch information...
1 parent 291bac8 commit 8d9bb8fbcf5a0bcb6d8ee6e47e674c938810fa1b loalf committed Jan 1, 2012
Showing with 49 additions and 0 deletions.
  1. +49 −0 tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
View
49 tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
@@ -0,0 +1,49 @@
+<?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']);
+ }
+}

0 comments on commit 8d9bb8f

Please sign in to comment.
Something went wrong with that request. Please try again.