4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Intl\Tests\ResourceBundle
;
14 use Symfony\Component\Intl\ResourceBundle\RegionBundle
;
17 * @author Bernhard Schussek <bschussek@gmail.com>
19 class RegionBundleTest
extends \PHPUnit_Framework_TestCase
21 const RES_DIR
= '/base/region';
29 * @var \PHPUnit_Framework_MockObject_MockObject
33 protected function setUp()
35 $this->reader
= $this->getMock('Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReaderInterface');
36 $this->bundle
= new RegionBundle(self
::RES_DIR
, $this->reader
);
39 public function testGetCountryName()
41 $this->reader
->expects($this->once())
43 ->with(self
::RES_DIR
, 'en', array('Countries', 'AT'))
44 ->will($this->returnValue('Austria'));
46 $this->assertSame('Austria', $this->bundle
->getCountryName('AT', 'en'));
49 public function testGetCountryNames()
51 $sortedCountries = array(
56 $this->reader
->expects($this->once())
58 ->with(self
::RES_DIR
, 'en', array('Countries'))
59 ->will($this->returnValue($sortedCountries));
61 $this->assertSame($sortedCountries, $this->bundle
->getCountryNames('en'));