ImboUnitTest\EventListener\ImageTransformationCacheTest::setUp PHP Method

setUp() public method

Set up the listener
public setUp ( )
    public function setUp()
    {
        if (!class_exists('org\\bovigo\\vfs\\vfsStream')) {
            $this->markTestSkipped('This testcase requires vfsStream to run');
        }
        $this->responseHeaders = $this->getMock('Symfony\\Component\\HttpFoundation\\ResponseHeaderBag');
        $this->requestHeaders = $this->getMock('Symfony\\Component\\HttpFoundation\\HeaderBag');
        $this->query = $this->getMock('Symfony\\Component\\HttpFoundation\\ParameterBag');
        $this->response = $this->getMock('Imbo\\Http\\Response\\Response');
        $this->response->headers = $this->responseHeaders;
        $this->request = $this->getMock('Imbo\\Http\\Request\\Request');
        $this->request->query = $this->query;
        $this->request->headers = $this->requestHeaders;
        $this->request->expects($this->any())->method('getUser')->will($this->returnValue($this->user));
        $this->request->expects($this->any())->method('getImageIdentifier')->will($this->returnValue($this->imageIdentifier));
        $this->event = $this->getMock('Imbo\\EventManager\\Event');
        $this->event->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
        $this->event->expects($this->any())->method('getResponse')->will($this->returnValue($this->response));
        $this->cacheDir = vfsStream::setup($this->path);
        $this->listener = new ImageTransformationCache(['path' => vfsStream::url($this->path)]);
    }