Skip to content

Commit

Permalink
[Validator] fixed unit tests when intl is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jul 20, 2011
1 parent e5fa78a commit e42a2de
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
Expand Up @@ -14,12 +14,14 @@
use Symfony\Component\Validator\Constraints\Country;
use Symfony\Component\Validator\Constraints\CountryValidator;

class CountryValidatorTest extends \PHPUnit_Framework_TestCase
class CountryValidatorTest extends LocalizedTestCase
{
protected $validator;

protected function setUp()
{
parent::setUp();

$this->validator = new CountryValidator();
}

Expand Down
Expand Up @@ -14,12 +14,14 @@
use Symfony\Component\Validator\Constraints\Language;
use Symfony\Component\Validator\Constraints\LanguageValidator;

class LanguageValidatorTest extends \PHPUnit_Framework_TestCase
class LanguageValidatorTest extends LocalizedTestCase
{
protected $validator;

protected function setUp()
{
parent::setUp();

$this->validator = new LanguageValidator();
}

Expand Down
Expand Up @@ -14,12 +14,14 @@
use Symfony\Component\Validator\Constraints\Locale;
use Symfony\Component\Validator\Constraints\LocaleValidator;

class LocaleValidatorTest extends \PHPUnit_Framework_TestCase
class LocaleValidatorTest extends LocalizedTestCase
{
protected $validator;

protected function setUp()
{
parent::setUp();

$this->validator = new LocaleValidator();
}

Expand Down
@@ -0,0 +1,22 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Tests\Component\Validator\Constraints;

abstract class LocalizedTestCase extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!extension_loaded('intl')) {
$this->markTestSkipped('The "intl" extension is not available');
}
}
}

0 comments on commit e42a2de

Please sign in to comment.