* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Asset\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\Asset\Package; use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy; use Symfony\Component\Asset\VersionStrategy\EmptyVersionStrategy; class PackageTest extends TestCase { /** * @dataProvider getConfigs */ public function testGetUrl($version, $format, $path, $expected) { $package = new Package($version ? new StaticVersionStrategy($version, $format) : new EmptyVersionStrategy()); $this->assertEquals($expected, $package->getUrl($path)); } public function getConfigs() { return array( array('v1', '', 'http://example.com/foo', 'http://example.com/foo'), array('v1', '', 'https://example.com/foo', 'https://example.com/foo'), array('v1', '', '//example.com/foo', '//example.com/foo'), array('v1', '', '/foo', '/foo?v1'), array('v1', '', 'foo', 'foo?v1'), array(null, '', '/foo', '/foo'), array(null, '', 'foo', 'foo'), array('v1', 'version-%2$s/%1$s', '/foo', '/version-v1/foo'), array('v1', 'version-%2$s/%1$s', 'foo', 'version-v1/foo'), array('v1', 'version-%2$s/%1$s', 'foo/', 'version-v1/foo/'), array('v1', 'version-%2$s/%1$s', '/foo/', '/version-v1/foo/'), ); } public function testGetVersion() { $package = new Package(new StaticVersionStrategy('v1')); $this->assertEquals('v1', $package->getVersion('/foo')); } } __halt_compiler();----SIGNATURE:----o4ms1jij55gutp/352W2TLN70V3MKdiG2V37oqjuU+XmCv42WYiCN4HljkucRNMZDqFwUgYm+DptLzLQ5wrtKndUmMXLX0djSAi2txjFMrvTBaf3bZyn0X1DJNFiNyaZdlk1DhmaDTAbhId6wN3ONKFNzfwxdC+nsgTLqwMNdmTAX6pdsUFvF8Xv6SJ7/ygL3vD3FJARdObOoou38a5nhasuv5ZE6WsWhCqtJZTEX+d5sG/pI6rSf+AAXGD2IEFRtHCAW95Jv6yQ6OhjZJKJtjPm1extocVeY8ISRk+LEvRqPj8LA1M/O/UkPjaJwoQsEGu5vFP+gM41gx8nUPQOhiRVPS7ZJarf1WEjHW/XiFRihSRDMCOttSkfXrOf1E6jEXBG4wgql+Hkkg3RTw2ktskp2xONlnqLgyzUPkBRyJUL2b9mI1XzaOVxqjmUvUBe0XfTLnjL4eQp/JpD+3nMXNc1ZIV5Gp6tFzaCP6TvLiOUTOYzBTB7nmBQKQtP2/0tPt456p6Db89xnsGLS3skCohbcZO/S1aBMWo8xN8tdZFeMj7xmZSrxWL23yMPGRTSOMEzbv5irrDzRRQW2ISrHO4L2a2eFqnP8KPbENelcaymfjjttPDm93OHoh6g+ktQmI/p6q3QRgZcRKgqrrJ3vPbf99JZAiykSPu/cGA6R8A=----ATTACHMENT:----NzU2NjIwNTgxNTU5NjA5MyA2NjIyNDY2Mzk0ODA1NzA4IDU1MjcyNjQxNjk3OTg2NjQ=