[Locale] Improved tests to use the IntlTestHelper class

This commit is contained in:
Bernhard Schussek 2013-03-16 01:38:31 +01:00
parent 03b78b0e00
commit 3dd75ff843
2 changed files with 7 additions and 10 deletions

View File

@ -12,8 +12,8 @@
namespace Symfony\Component\Locale\Tests; namespace Symfony\Component\Locale\Tests;
use Symfony\Component\Intl\Intl; use Symfony\Component\Intl\Intl;
use Symfony\Component\Intl\Tests\IntlTestCase;
use Symfony\Component\Intl\Util\IcuVersion; use Symfony\Component\Intl\Util\IcuVersion;
use Symfony\Component\Intl\Util\IntlTestHelper;
use Symfony\Component\Locale\Locale; use Symfony\Component\Locale\Locale;
/** /**
@ -21,18 +21,12 @@ use Symfony\Component\Locale\Locale;
* *
* @author Bernhard Schussek <bschussek@gmail.com> * @author Bernhard Schussek <bschussek@gmail.com>
*/ */
class LocaleTest extends IntlTestCase class LocaleTest extends \PHPUnit_Framework_TestCase
{ {
protected function setUp() protected function setUp()
{ {
// This class extends from \Ļocale, so we need the extension // Locale extends \Locale, so intl must be present
if (!Intl::isExtensionLoaded()) { IntlTestHelper::requireIntl($this);
$this->markTestSkipped('The intl extension is not available.');
}
Intl::setDataSource(Intl::STUB);
Locale::setDefault('en');
} }
public function testGetDisplayCountries() public function testGetDisplayCountries()

View File

@ -22,7 +22,10 @@ class StubLocaleTest extends \PHPUnit_Framework_TestCase
{ {
protected function setUp() protected function setUp()
{ {
// Force the use of stub data to have consistent results
Intl::setDataSource(Intl::STUB); Intl::setDataSource(Intl::STUB);
parent::setUp();
} }
public function testGetCurrenciesData() public function testGetCurrenciesData()