* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Asset\Tests\VersionStrategy; use PHPUnit\Framework\TestCase; use Symfony\Component\Asset\VersionStrategy\JsonManifestVersionStrategy; class JsonManifestVersionStrategyTest extends TestCase { public function testGetVersion() { $strategy = $this->createStrategy('manifest-valid.json'); $this->assertEquals('main.123abc.js', $strategy->getVersion('main.js')); } public function testApplyVersion() { $strategy = $this->createStrategy('manifest-valid.json'); $this->assertEquals('css/styles.555def.css', $strategy->getVersion('css/styles.css')); } public function testApplyVersionWhenKeyDoesNotExistInManifest() { $strategy = $this->createStrategy('manifest-valid.json'); $this->assertEquals('css/other.css', $strategy->getVersion('css/other.css')); } /** * @expectedException \RuntimeException */ public function testMissingManifestFileThrowsException() { $strategy = $this->createStrategy('non-existent-file.json'); $strategy->getVersion('main.js'); } /** * @expectedException \RuntimeException * @expectedExceptionMessage Error parsing JSON */ public function testManifestFileWithBadJSONThrowsException() { $strategy = $this->createStrategy('manifest-invalid.json'); $strategy->getVersion('main.js'); } private function createStrategy($manifestFilename) { return new JsonManifestVersionStrategy(__DIR__.'/../fixtures/'.$manifestFilename); } } __halt_compiler();----SIGNATURE:----XVmB1LQ+6pmQDk0zFnIlD2ABCktz/12+56+KAgHn8sUV5GMt7S6F90Ik10sQ/v2ZeyAMf81ZsAFbZrxSddxROKBrwBvpOKkJK0QOk/tzc80ay7lhRED56WDdd4aKP95hyMSP9E2oCf1z2AA71jw7HhaDIXNuE8ObX+8EXeeBvzx6+FCNPikoAiAcB9bK63WJaK34REiBII5iKUnrvsA0G4yH9u+VHSf+J2+mk38bUpUxM9OiluDdy1jvs6EYrAC56cZVaFu27C68hZ0aaQ3ktPVpAWa2xTsAs7Cs3EarOpGpjvbIvUqIjFlGNv/slqp4ncvX1eU4nAmyBW+ErcEWTCl2TAuFZbOlx7P2AWkRGF/0vKJRfQMS8meBPKtpf/RHSPUSaYicOSsWhvDq8lYTCSaXB4ZEPPFZ193X12vymFirje/zb81NUiPZmikNkvAk4AGLqP5T7FiS80R/t8lUL1mP1Rp/oQACUoS4uQ5kJ5ZyX/NpGdMra6FXjPGr8eKDHYi+1NfDxRndCXxFoRzHl87JxgZQX/vLYmPzsoRpwLBYHFV1zTSNKzlCuqTFf95BBMIZr8NWzJbLGCLv2Kvcr4Ywbq/CU26V0b//rccw8P9R7Y4noz3kT6ZSJDHQKZf9rddIPLV82Bkn+IL5LAIiqgNE9yhRdnmTcrfVneE+n30=----ATTACHMENT:----MjE5OTA4NzMxMDY5MzA1MSA5MTMyOTk0NjQ5MjQ4ODYxIDk1NDc1OTM3NzI0ODY3Mg==