setMimeResolver() public method

Set the mime resolver
public setMimeResolver ( AssetManager\Service\MimeResolver $resolver )
$resolver AssetManager\Service\MimeResolver
 /**
  *
  * @return ResolverInterface
  */
 protected function getResolver()
 {
     $mimeResolver = new MimeResolver();
     $resolver = new MapResolver(array(self::$assetName => __DIR__ . '/../../_files/require-jquery.js'));
     $resolver->setMimeResolver($mimeResolver);
     return $resolver;
 }
Esempio n. 2
0
 private function getGenericResolver()
 {
     $resolver = new MapResolver();
     $this->assertTrue($resolver instanceof MimeResolverAwareInterface);
     $mimeResolver = new MimeResolver();
     $resolver->setMimeResolver($mimeResolver);
     return $resolver;
 }
 public function testResolveHttpAssetSuccess()
 {
     $resolver = new MapResolver();
     $mimeResolver = $this->getMock('AssetManager\\Service\\MimeResolver');
     $mimeResolver->expects($this->any())->method('getMimeType')->with('http://foo.bar/')->will($this->returnValue('text/foo'));
     $resolver->setMimeResolver($mimeResolver);
     $asset1 = array('bacon' => 'http://foo.bar/');
     $resolver->setMap($asset1);
     $asset = $resolver->resolve('bacon');
     $this->assertTrue($asset instanceof Asset\HttpAsset);
     $this->assertSame('text/foo', $asset->mimetype);
 }