Example #1
0
 public function testGetDoesNotUseCacheForSecondCall()
 {
     $cache = Mockery::mock('\\Imdb\\Cache');
     $cache->shouldReceive('get')->once()->andReturn('test');
     $pages = new Pages(new Config(), $cache, new Logger());
     $result = $pages->get('/');
     $this->assertEquals('test', $result);
     $result2 = $pages->get('/');
     $this->assertEquals('test', $result2);
 }
Example #2
0
 /**
  * Get a page from IMDb, which will be cached in memory for repeated use
  * @param string $context Name of the page or some other context to build the URL with to retrieve the page
  * @return string
  */
 protected function getPage($context = null)
 {
     return $this->pages->get($this->buildUrl($context));
 }