Initial commit: apps.supersam24.ru
This commit is contained in:
commit
e955e1da36
6566 files changed
+1271095
No files matched your search
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
namespace Aura\Intl;
|
||||
|
||||
class FormatterLocatorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function test__constructAndGet()
|
||||
{
|
||||
$formatters = new FormatterLocator([
|
||||
'mock' => function () {
|
||||
return new \Aura\Intl\MockFormatter;
|
||||
},
|
||||
]);
|
||||
|
||||
$expect = 'Aura\Intl\MockFormatter';
|
||||
$actual = $formatters->get('mock');
|
||||
$this->assertInstanceOf($expect, $actual);
|
||||
}
|
||||
|
||||
public function testSetAndGet()
|
||||
{
|
||||
$formatters = new FormatterLocator;
|
||||
$formatters->set('mock', function () {
|
||||
return new \Aura\Intl\MockFormatter;
|
||||
});
|
||||
|
||||
$expect = 'Aura\Intl\MockFormatter';
|
||||
$actual = $formatters->get('mock');
|
||||
$this->assertInstanceOf($expect, $actual);
|
||||
}
|
||||
|
||||
public function testGet_noSuchFormatter()
|
||||
{
|
||||
$formatters = new FormatterLocator;
|
||||
$this->setExpectedException('Aura\Intl\Exception\FormatterNotMapped');
|
||||
$formatters->get('noSuchFormatter');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user