/** * @param string $strTld * @param boolean $booIntranet * @param boolean $booTrue * * @covers Etechnika\ExtLib\Domain\TldUtils::isValid * @dataProvider providerIsValid */ public function testIsValid($strTld, $booIntranet, $booTrue) { if ($booTrue) { $this->assertTrue(TldUtils::isValid($strTld, $booIntranet), 'Tld name: ' . $strTld . ' intranet: ' . var_export($booIntranet, true)); } else { $this->assertFalse(TldUtils::isValid($strTld, $booIntranet), 'Tld name: ' . $strTld . ' intranet: ' . var_export($booIntranet, true)); } }
/** * Construct * * @param String $strTld * @param boolean $booIntranet * * @throws InvalidTldException */ public function __construct($strTld, $booIntranet = false) { $strTld = TldUtils::removeDot($strTld); if (!TldUtils::isValid($strTld, $booIntranet)) { throw new InvalidTldException('Invalid tld "' . var_export($strTld, true) . '"'); } $this->strName = strtolower($strTld); }