Exemplo n.º 1
0
 /**
  * @covers ::getContent
  */
 public function testGetContent()
 {
     $this->assertInternalType('array', $this->sut->getContent());
     foreach ($this->sut->getContent() as $content) {
         $this->assertInstanceOf('\\Triquanta\\IziTravel\\DataType\\CountryContentInterface', $content);
     }
 }
Exemplo n.º 2
0
 /**
  * @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;
 }
Exemplo n.º 3
0
 /**
  * @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();
 }
Exemplo n.º 5
0
 /**
  * @test
  */
 public function getContentReturnsContentCorrectly()
 {
     $this->mockResponse->_set('content', 'foo');
     $this->assertSame('foo', $this->mockResponse->getContent());
 }
Exemplo n.º 6
0
 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);
 }