/** * * @return ResolverInterface */ protected function getResolver() { $mimeResolver = new MimeResolver(); $resolver = new MapResolver(array(self::$assetName => __DIR__ . '/../../_files/require-jquery.js')); $resolver->setMimeResolver($mimeResolver); return $resolver; }
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); }
/** * Test Collect returns valid list of assets * * @covers \AssetManager\Resolver\MapResolver::collect */ public function testCollect() { $map = array('foo' => 'bar', 'baz' => 'qux'); $resolver = new MapResolver($map); $this->assertEquals(array_keys($map), $resolver->collect()); }