/** * getBySiteKey * * @param string $siteKey site key string * * @return Site */ public function getBySiteKey($siteKey) { return $this->repository->findBySiteKey($siteKey); }
/** * testFindBySiteKeyException * * @return void */ public function testFindBySiteKeyException() { $this->setExpectedException('Xpressengine\\Site\\Exceptions\\NotFoundSiteException'); $repo = new SiteRepository($this->conn); $query = $this->query; $query->shouldReceive('where')->andReturn($query); $query->shouldReceive('first')->andReturn(null); $repo->findBySiteKey('test'); }