Ejemplo n.º 1
0
 public function testGetThumbImages_empty()
 {
     $request = $this->getMockBuilder('WikiaRequest')->disableOriginalConstructor()->setMethods(['getVal', 'getInt'])->getMock();
     $request->expects($this->at(0))->method('getInt')->with('count', $this->anything())->will($this->returnValue(20));
     $request->expects($this->at(1))->method('getVal')->with('to', $this->anything())->will($this->returnValue(0));
     // Empty timestamp
     $request->expects($this->at(2))->method('getVal')->with('inclusive', $this->anything())->will($this->returnValue(''));
     $lightboxController = new \LightboxController();
     $lightboxController->setRequest($request);
     $response = new \WikiaResponse(\WikiaResponse::FORMAT_HTML);
     $lightboxController->setResponse($response);
     $lightboxController->getThumbImages();
     // Inspect response object
     $this->assertEquals([], $lightboxController->getResponse()->getVal('thumbs'));
     $this->assertEquals(0, $lightboxController->getResponse()->getVal('to'));
 }