* * 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\Bundle\Reader; use PHPUnit\Framework\TestCase; use Symfony\Component\Intl\Data\Bundle\Reader\PhpBundleReader; /** * @author Bernhard Schussek */ class PhpBundleReaderTest extends TestCase { /** * @var PhpBundleReader */ private $reader; protected function setUp() { $this->reader = new PhpBundleReader(); } public function testReadReturnsArray() { $data = $this->reader->read(__DIR__.'/Fixtures/php', 'en'); $this->assertInternalType('array', $data); $this->assertSame('Bar', $data['Foo']); $this->assertArrayNotHasKey('ExistsNot', $data); } /** * @expectedException \Symfony\Component\Intl\Exception\ResourceBundleNotFoundException */ public function testReadFailsIfNonExistingLocale() { $this->reader->read(__DIR__.'/Fixtures/php', 'foo'); } /** * @expectedException \Symfony\Component\Intl\Exception\RuntimeException */ public function testReadFailsIfNonExistingDirectory() { $this->reader->read(__DIR__.'/foo', 'en'); } /** * @expectedException \Symfony\Component\Intl\Exception\RuntimeException */ public function testReadFailsIfNotAFile() { $this->reader->read(__DIR__.'/Fixtures/NotAFile', 'en'); } /** * @expectedException \Symfony\Component\Intl\Exception\ResourceBundleNotFoundException */ public function testReaderDoesNotBreakOutOfGivenPath() { $this->reader->read(__DIR__.'/Fixtures/php', '../invalid_directory/en'); } } __halt_compiler();----SIGNATURE:----Kn1vkLcTyrDau5ZUDThVtyJ7KwWoLLu2xl/knDOnYiwB5oisf1b66bVcwgizcBjUfI+eQHA85M/mSWYorJyTS8es4PFnYdqdijSfH3ySoG6NjDCpVfVJQ04s98il1K/CGkOJgSjrogTOyFXgkcW7E5MsqS2tMLIw2XWaPftPvFz1HeYSZaLGQbEZIK+bsk3vIZ7o8FNu3/7/Pfh6TtZQxFtfApS5mlPHmFRTAClP1hqnGD8HCsfdJCHLjv11vVuzdi24V0jQVh+VhhCUxsuVKK7jPRdeorjwI2qP1whtRlpV8Amn+dbIvA1ZZKlzcuIu2HSE45YttZtIO1cb0tTeqKKjBh4ufq53XxLbGvtZWLf5o7YQujp1sIRDFZUwVwhTyYK+rdRPbj660GokW1p6lajPSUqFCE+GIGd9Bjj152Jmr7k8klqXpnh8tsPqajEM+NaqNuE0D9GWLQvDgKuwVar6ABnrrd75xMfuj73a/mdpKTTfnwbAC8dooDSE5a2cP912rsohuBoWIfHVc2EfH09NDZGNYlT3getUlkMrL0UVQ9b/jEZAyhl9TWtvqu+HJoof+r1hU27d3MAEZLdMzfUf5JdiaFQyTB6YbthvHxmzRp0HMERBaSBLj8u5ijQJ4NLxvCmIe+uQ66XOwOPezMoJG7XeF53UT0vYWgnSVWw=----ATTACHMENT:----NDc0Mjc5ODc4NjA2MTU5OSA1OTYyNjIzNzM1NTA5ODUgNDc0MjMxODg0NTcwMTIzNQ==