inner = $this->getMock('Assetic\\Asset\\AssetInterface'); $this->cache = $this->getMock('Assetic\\Cache\\CacheInterface'); $this->asset = new AssetCache($this->inner, $this->cache); } public function testLoadFromCache() { $content = 'asdf'; $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); $this->inner->expects($this->once()) ->method('getFilters') ->will($this->returnValue(array($filter))); $this->cache->expects($this->once()) ->method('has') ->with($this->isType('string')) ->will($this->returnValue(true)); $this->cache->expects($this->once()) ->method('get') ->with($this->isType('string')) ->will($this->returnValue($content)); $this->inner->expects($this->once()) ->method('setContent') ->with($content); $this->asset->load($filter); } public function testLoadToCache() { $content = 'asdf'; $this->inner->expects($this->once()) ->method('getFilters') ->will($this->returnValue(array())); $this->cache->expects($this->once()) ->method('has') ->with($this->isType('string')) ->will($this->returnValue(false)); $this->inner->expects($this->once())->method('load'); $this->inner->expects($this->once()) ->method('getContent') ->will($this->returnValue($content)); $this->cache->expects($this->once()) ->method('set') ->with($this->isType('string'), $content); $this->asset->load(); } public function testDumpFromCache() { $content = 'asdf'; $this->inner->expects($this->once()) ->method('getFilters') ->will($this->returnValue(array())); $this->cache->expects($this->once()) ->method('has') ->with($this->isType('string')) ->will($this->returnValue(true)); $this->cache->expects($this->once()) ->method('get') ->with($this->isType('string')) ->will($this->returnValue($content)); $this->assertEquals($content, $this->asset->dump(), '->dump() returns the cached value'); } public function testDumpToCache() { $content = 'asdf'; $this->inner->expects($this->once()) ->method('getFilters') ->will($this->returnValue(array())); $this->cache->expects($this->once()) ->method('has') ->with($this->isType('string')) ->will($this->returnValue(false)); $this->inner->expects($this->once()) ->method('dump') ->will($this->returnValue($content)); $this->cache->expects($this->once()) ->method('set') ->with($this->isType('string'), $content); $this->assertEquals($content, $this->asset->dump(), '->dump() returns the dumped value'); } public function testEnsureFilter() { $filter = $this->getMock('Assetic\\Filter\\FilterInterface'); $this->inner->expects($this->once())->method('ensureFilter'); $this->asset->ensureFilter($filter); } public function testGetFilters() { $this->inner->expects($this->once()) ->method('getFilters') ->will($this->returnValue(array())); $this->assertInternalType('array', $this->asset->getFilters(), '->getFilters() returns the inner asset filters'); } public function testGetContent() { $this->inner->expects($this->once()) ->method('getContent') ->will($this->returnValue('asdf')); $this->assertEquals('asdf', $this->asset->getContent(), '->getContent() returns the inner asset content'); } public function testSetContent() { $this->inner->expects($this->once()) ->method('setContent') ->with('asdf'); $this->asset->setContent('asdf'); } public function testGetSourceRoot() { $this->inner->expects($this->once()) ->method('getSourceRoot') ->will($this->returnValue('asdf')); $this->assertEquals('asdf', $this->asset->getSourceRoot(), '->getSourceRoot() returns the inner asset source root'); } public function testGetSourcePath() { $this->inner->expects($this->once()) ->method('getSourcePath') ->will($this->returnValue('asdf')); $this->assertEquals('asdf', $this->asset->getSourcePath(), '->getSourcePath() returns the inner asset source path'); } public function testGetLastModified() { $this->inner->expects($this->once()) ->method('getLastModified') ->will($this->returnValue(123)); $this->assertEquals(123, $this->asset->getLastModified(), '->getLastModified() returns the inner asset last modified'); } } __halt_compiler();----SIGNATURE:----OGhhpNDl1VnFhQWr/HaeHC995WdzfBhZ4gDXm3QjFPCic8sCE7/DTTslsQ60AfSEXmZpF9szp2r+mkT4NXpF4924dTl1QSzJidw5ph67ZiMArzNExjTHpoXa2CJ82AQBi2k7lQflDNzAWbVpcEN1+2NE4ak/ZQdJnVjuYpRSQgAj/ie0LMyY8+c5P2YF4IiZ+09y6cq47IO5j0Ay6ymSpWb7JmNpwzhX1zRtqeU9fRXaSBuM2Y6JjkBBzAw55yZHv5mG9EXAikX/4+yp3yJhP55pH84kOHI5v4zUEy6ryNTXv9ldd/oqRTaqs3KKp8Jzh6iNz6pZCWvE2uK1MpBp64Np8TjQhtcJW14c5BhM5Dc+RwuopYho0SYVIeR/Aj5u8gb4MLetyjVRljsU+Va0KTQweEzm/HrRS9Dxvfxev7tpdazIaRIjhONE2ZbwS+yLEb+RWiA/+XrDV9fsn96V9P3/b4Pqt7oViIyA/FBVbwn8w8RDwlslFBH2x8trS1H/iU5JWaOn0+3/rLIieD+wB2895eloYqJdcWOnA6YBKyUlOYAo18fgGG3VL/ij9XKYy+u3sIuSpli1Zt5e7Ls8VlfQuVrSU6s+A+HEJBvIYgvPEZt0z39tZSkzKufs0m+xxVgWOgMKtKDiIWPY7G7X+xx4axWqpiQ2BdrBkoUj59c=----ATTACHMENT:----NTE2MzA4NTQ5MzM2NDUyOSA1MjgyNzc4MjUyNjg5MjE2IDcxMDEwMjUzMDk0MTk4OQ==