* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\Tests\Data\Util; use PHPUnit\Framework\TestCase; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Intl\Data\Util\LocaleScanner; /** * @author Bernhard Schussek */ class LocaleScannerTest extends TestCase { private $directory; /** * @var Filesystem */ private $filesystem; /** * @var LocaleScanner */ private $scanner; protected function setUp() { $this->directory = sys_get_temp_dir().'/LocaleScannerTest/'.mt_rand(1000, 9999); $this->filesystem = new Filesystem(); $this->scanner = new LocaleScanner(); $this->filesystem->mkdir($this->directory); $this->filesystem->touch($this->directory.'/en.txt'); $this->filesystem->touch($this->directory.'/en_alias.txt'); $this->filesystem->touch($this->directory.'/de.txt'); $this->filesystem->touch($this->directory.'/de_alias.txt'); $this->filesystem->touch($this->directory.'/fr.txt'); $this->filesystem->touch($this->directory.'/fr_alias.txt'); $this->filesystem->touch($this->directory.'/root.txt'); $this->filesystem->touch($this->directory.'/supplementalData.txt'); $this->filesystem->touch($this->directory.'/supplementaldata.txt'); $this->filesystem->touch($this->directory.'/meta.txt'); file_put_contents($this->directory.'/en_alias.txt', 'en_alias{"%%ALIAS"{"en"}}'); file_put_contents($this->directory.'/de_alias.txt', 'de_alias{"%%ALIAS"{"de"}}'); file_put_contents($this->directory.'/fr_alias.txt', 'fr_alias{"%%ALIAS"{"fr"}}'); } protected function tearDown() { $this->filesystem->remove($this->directory); } public function testScanLocales() { $sortedLocales = array('de', 'de_alias', 'en', 'en_alias', 'fr', 'fr_alias'); $this->assertSame($sortedLocales, $this->scanner->scanLocales($this->directory)); } public function testScanAliases() { $sortedAliases = array('de_alias' => 'de', 'en_alias' => 'en', 'fr_alias' => 'fr'); $this->assertSame($sortedAliases, $this->scanner->scanAliases($this->directory)); } } __halt_compiler();----SIGNATURE:----ryLKsBvzChlkhQvplOweizZYtFUFBGq2kKPspLM+2fjlq5sg8/Du12blgoz1rmZB7z7Zr1ir6mLr+CdjnrFkHfNZdey5TJY5oy6D3Y2ZntKxrIKlmfYI637Ohuq259CDZ+D4BIuG5T7wfjW4Y7FMM0M3jpLpxyU02NdJ0Hq6d+VdnRSl7nTVEwzPBhur5CnG2leiUxYXfPYreeX5yuHj4wEDqmk5cZmHHMi3AqCZ5v7cqfV+ty9iWRKPWwdvQLRhXkgfngaPSzPOX7kLzzUSlNG1PzKX+h8MgATHhX2NSis7z2wjzYBKnyiod3gki/RbMZaYxbxpA+ashkE0O6X6MbhMnDq+UdvyT+J7PykJX0Bay5lqmX3wZ6H/9Vq953EdAQuzEvAideFyUlbYfc/+ezwD3DT0WVWNfdsFo7dnoDP8x18ToBF+7tTMde+bFB6NIHmwIwR6QGfvKbBrSpQUR1ARa+5oHjtpCV8AkhJQho7CoqB4gnYYT8LjKaSdq7l2LFE2uSiAbQHpXrUOdUDFfJK8PXeAKbjasXv5JLhfXu+XJ1DSvJFyX+K34hUkaBzLEVeliWz9o0oJ3PZIwHjF48MTfdko7gSkwmNcBclkZHyArgTAenp2AGkn3NQirTESg3WVqWGNqxIOV7HIMgBgx6lWs9JGXkq58kcfHoKFCK4=----ATTACHMENT:----OTMzOTM2MzYyMzA5NjE1IDQzMjE1MTI0NDQ0NTQ1MzEgMTY5ODMzNDA3NTE4NjMzNg==