コード例 #1
0
 public function testProd()
 {
     $ar = new \Serebro\Assets\Revision('prod');
     $ar->setRevisionMap(self::$revisionMap);
     $ar->setPrefix('http://example.com');
     $this->assertEquals('http://example.com/js/file-73a4818b.min.js', $ar->getUrl('file.js'));
 }
コード例 #2
0
 public function testExtOutput()
 {
     \Serebro\Assets\Manager::reset();
     $am = \Serebro\Assets\Manager::getInstance();
     $ar = new \Serebro\Assets\Revision('prod');
     $ar->setRevisionMap(self::$revisionMap);
     $ar->setPrefix('http://example.com');
     $resource = new \NewResourceType('file.test', true, ['data-id' => '12345']);
     $am->setRevisionManager($ar)->add($resource);
     $expected = '<test data-id="12345" type="test/test" src="http://example.com/test/file-f914a832.test"></test>';
     $this->assertEquals($expected, $am->output('head', '\\NewResourceType'));
     \Serebro\Assets\Manager::setResourceTypes(['test' => '\\NewResourceType']);
     $this->assertEquals($expected, $am->output('head', 'test'));
 }