diff options
Diffstat (limited to 'vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/AbstractBundleReaderTest.php')
-rw-r--r-- | vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/AbstractBundleReaderTest.php | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/AbstractBundleReaderTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/AbstractBundleReaderTest.php deleted file mode 100644 index 2da7f90d..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/Reader/AbstractBundleReaderTest.php +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Intl\Tests\ResourceBundle\Reader; | ||
13 | |||
14 | use Symfony\Component\Filesystem\Filesystem; | ||
15 | |||
16 | /** | ||
17 | * @author Bernhard Schussek <bschussek@gmail.com> | ||
18 | */ | ||
19 | class AbstractBundleReaderTest extends \PHPUnit_Framework_TestCase | ||
20 | { | ||
21 | private $directory; | ||
22 | |||
23 | /** | ||
24 | * @var Filesystem | ||
25 | */ | ||
26 | private $filesystem; | ||
27 | |||
28 | /** | ||
29 | * @var \PHPUnit_Framework_MockObject_MockObject | ||
30 | */ | ||
31 | private $reader; | ||
32 | |||
33 | protected function setUp() | ||
34 | { | ||
35 | $this->directory = sys_get_temp_dir() . '/AbstractBundleReaderTest/' . rand(1000, 9999); | ||
36 | $this->filesystem = new Filesystem(); | ||
37 | $this->reader = $this->getMockForAbstractClass('Symfony\Component\Intl\ResourceBundle\Reader\AbstractBundleReader'); | ||
38 | |||
39 | $this->filesystem->mkdir($this->directory); | ||
40 | } | ||
41 | |||
42 | protected function tearDown() | ||
43 | { | ||
44 | $this->filesystem->remove($this->directory); | ||
45 | } | ||
46 | |||
47 | public function testGetLocales() | ||
48 | { | ||
49 | $this->filesystem->touch($this->directory . '/en.foo'); | ||
50 | $this->filesystem->touch($this->directory . '/de.foo'); | ||
51 | $this->filesystem->touch($this->directory . '/fr.foo'); | ||
52 | $this->filesystem->touch($this->directory . '/bo.txt'); | ||
53 | $this->filesystem->touch($this->directory . '/gu.bin'); | ||
54 | $this->filesystem->touch($this->directory . '/s.lol'); | ||
55 | |||
56 | $this->reader->expects($this->any()) | ||
57 | ->method('getFileExtension') | ||
58 | ->will($this->returnValue('foo')); | ||
59 | |||
60 | $sortedLocales = array('de', 'en', 'fr'); | ||
61 | |||
62 | $this->assertSame($sortedLocales, $this->reader->getLocales($this->directory)); | ||
63 | } | ||
64 | } | ||