<?php
namespace Aura\Intl;
class PackageLocatorTest extends \PHPUnit_Framework_TestCase
{
protected $packages;
protected function setUp()
{
parent::setUp();
$this->packages = new PackageLocator([
'Vendor.Foo' => [
'en_US' => function () {
return new \Aura\Intl\Package;
},
],
]);
}
public function testGet()
{
$first = $this->packages->get('Vendor.Foo', 'en_US');
$this->assertInstanceOf('Aura\Intl\Package', $first);
$again = $this->packages->get('Vendor.Foo', 'en_US');
$this->assertSame($first, $again);
$this->setExpectedException('Aura\Intl\Exception');
$this->packages->get('Vendor.Bar', 'en_US');
}
}