/** * checkUsableDomain * * @param string $host site host * * @return void * @throws CanNotUseDomainException */ protected function checkUsableDomain($host) { if ($this->repository->count($host) > 0) { throw new CanNotUseDomainException(['host' => $host]); } }
/** * countByUrl * * @return void */ public function testCountByUrl() { $repo = new SiteRepository($this->conn); $query = $this->query; $query->shouldReceive('where')->andReturn($query); $query->shouldReceive('count')->andReturn(1); $affected = $repo->count('test.com'); $this->assertEquals(1, $affected); }