* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Translation\Tests\Loader; use PHPUnit\Framework\TestCase; use Symfony\Component\Translation\Loader\PhpFileLoader; use Symfony\Component\Config\Resource\FileResource; class PhpFileLoaderTest extends TestCase { public function testLoad() { $loader = new PhpFileLoader(); $resource = __DIR__.'/../fixtures/resources.php'; $catalogue = $loader->load($resource, 'en', 'domain1'); $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); $this->assertEquals('en', $catalogue->getLocale()); $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); } /** * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException */ public function testLoadNonExistingResource() { $loader = new PhpFileLoader(); $resource = __DIR__.'/../fixtures/non-existing.php'; $loader->load($resource, 'en', 'domain1'); } /** * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException */ public function testLoadThrowsAnExceptionIfFileNotLocal() { $loader = new PhpFileLoader(); $resource = 'http://example.com/resources.php'; $loader->load($resource, 'en', 'domain1'); } } __halt_compiler();----SIGNATURE:----QH1LISVhU7vtF03O6KDRJyEt9a943/Ot0FAwAoNzxU1dTUapWkBlp1Fg1iG7GnCft17o6k1vMH2qwXvyvR52k2rQaJ9QCwt5luCs71siu8Ihlri3johaYvcQtqNQXWTTXViuO34r1D/Kns6i9VDTH17s2XyGaCQqTKq7TpCZWOGeVGpZP/spkM1fR72v/SdozfbayP4BHrr4958ofG1wRPEW1QSstlvtPq/knFkFrX2HQiSKYZ+L2idyZAEmlpOqrHr99hXyI29BtVE3FEWy9IAkJpPy0MW0EhJI6cUIIbjsqK13KCYEuKcl5f7zid9ViEVT5qO3hI7koXOgp6FSowgHdWubrgHfpT7JAdZfgotktL04Z6bWn+ktZZnR27QgBhO0we8FonTRTg7Z/BCcooQOLX1cF2abAAmPa4pwwLjKgOj3pAD+Euz3SCwfolwAlWHxYXL4xeqhGhuOi9puTciqfRe4f/08gpwYYM/6WO4mpY+DdhSFjmI2age54r5zXUGgKnF4P8cbtLdQlzK+Ok3s2wv1ZYpWSaAVgFZlPRX0eZx5OitXyXrYx8bXYAEnaI8YjYk+n6BGxT9542EdyiZXW1AAHpjh+/jT6jSTHFXqRM5Y5DhiS7U3VLTEOYzzfE6s+zIdeooMloFTuQ4X5qpNlCfsBTBTwzi61NXPlv8=----ATTACHMENT:----NDIxNTU0MjUxMTQxMzM2NiAxOTQ5NzE4ODgxNDkyNDg3IDgyMTk2ODg0NjMwNjEzNzQ=