ImboUnitTest\Resource\ImageTest::testSupportsHttpGet PHP Метод

testSupportsHttpGet() публичный Метод

public testSupportsHttpGet ( )
    public function testSupportsHttpGet()
    {
        $user = 'christer';
        $imageIdentifier = 'imageIdentifier';
        $responseHeaders = $this->getMock('Symfony\\Component\\HttpFoundation\\HeaderBag');
        $this->request->expects($this->once())->method('getUser')->will($this->returnValue($user));
        $this->request->expects($this->once())->method('getImageIdentifier')->will($this->returnValue($imageIdentifier));
        $this->response->headers = $responseHeaders;
        $this->response->expects($this->once())->method('setModel')->with($this->isInstanceOf('Imbo\\Model\\Image'));
        $this->manager->expects($this->at(0))->method('trigger')->with('db.image.load');
        $this->manager->expects($this->at(1))->method('trigger')->with('storage.image.load');
        $this->response->expects($this->once())->method('setMaxAge')->with(31536000)->will($this->returnSelf());
        $responseHeaders->expects($this->once())->method('add')->with($this->callback(function ($headers) {
            return array_key_exists('X-Imbo-OriginalMimeType', $headers) && array_key_exists('X-Imbo-OriginalWidth', $headers) && array_key_exists('X-Imbo-OriginalHeight', $headers) && array_key_exists('X-Imbo-OriginalFileSize', $headers) && array_key_exists('X-Imbo-OriginalExtension', $headers);
        }));
        $this->resource->getImage($this->event);
    }