/**
  * @test
  * @dataProvider domainProvider
  */
 public function checkAvailable($domain, $isAvailable)
 {
     try {
         $result = $this->client->isAvailable($domain);
         if ($result !== $isAvailable) {
             echo "\n{$domain}\n";
             print_r($this->client->getLastWhoisResult());
             echo "\n";
         }
         $this->assertEquals($isAvailable, $result);
     } catch (QuotaExceededException $e) {
         $this->markTestSkipped(sprintf('Quota for WHOIS server exceeded: %s', $domain));
     } catch (WhoisException $e) {
         $this->markTestSkipped(sprintf('WHOIS failed for: %s', $domain));
     }
 }
Example #2
0
 /**
  * @test
  * @covers Cocur\Domain\Availability\Client::isAvailable()
  * @expectedException Cocur\Domain\Availability\AvailabilityException
  */
 public function isAvailableHasNoPattern()
 {
     $this->data->shouldReceive('getByTld')->with('com')->once()->andReturn([]);
     $this->client->isAvailable('florianeckerstorfer.com');
 }