public function testStoreIsForwardedToResolver() { $binary = new Binary('aContent', 'image/jpeg', 'jpg'); $resolver = $this->createResolverMock(); $resolver->expects($this->exactly(2))->method('store')->with($this->identicalTo($binary), $this->webPath, $this->filter); $cacheResolver = new CacheResolver(new ArrayCache(), $resolver); // Call twice, as this method should not be cached. $this->assertNull($cacheResolver->store($binary, $this->webPath, $this->filter)); $this->assertNull($cacheResolver->store($binary, $this->webPath, $this->filter)); }
public function testStoreIsForwardedToResolver() { $response = new Response(); $resolver = $this->getMockResolver(); $resolver->expects($this->exactly(2))->method('store')->with($response, $this->targetPath, $this->filter)->will($this->returnValue($response)); $cacheResolver = new CacheResolver(new MemoryCache(), $resolver); // Call twice, as this method should not be cached. $this->assertSame($response, $cacheResolver->store($response, $this->targetPath, $this->filter)); $this->assertSame($response, $cacheResolver->store($response, $this->targetPath, $this->filter)); }