/** * @covers ::getContent */ public function testGetContent() { $this->assertInternalType('array', $this->sut->getContent()); foreach ($this->sut->getContent() as $content) { $this->assertInstanceOf('\\Triquanta\\IziTravel\\DataType\\CountryContentInterface', $content); } }
/** * @param object|\PHPUnit_Framework_MockObject_MockObject $file * * @return array<string,mixed> */ private function mockBase64PreviewData($file) { $preview = ['preview' => base64_encode($file->getContent()), 'mimetype' => 'image/png']; return $preview; }
/** * @param object|\PHPUnit_Framework_MockObject_MockObject $file * @param $filename * * @return array */ private function mockDownloadData($file, $filename) { $download = ['preview' => $file->getContent(), 'mimetype' => $file->getMimeType()]; if ($download) { if (is_null($filename)) { $filename = $file->getName(); } $download['name'] = $filename; } return $download; }
/** * @expectedException \WebExtractor\Exception\ContentNotSetException */ public function testDefaultGetContentThrowsException() { $this->extractor->getContent(); }
/** * @test */ public function getContentReturnsContentCorrectly() { $this->mockResponse->_set('content', 'foo'); $this->assertSame('foo', $this->mockResponse->getContent()); }
public function testGetContentSendsContentRequestWithLimitAndOffset() { $this->mockHttpClient->expects($this->once())->method('get')->with('content?site_key=key&limit=25&offset=5')->will($this->returnValue($this->mockRequest)); $this->object->getContent(array(), null, null, 25, 5); }