예제 #1
0
 /**
  * @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));
     }
 }
예제 #2
0
파일: Tld.php 프로젝트: etechnika/ext-lib
 /**
  * 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);
 }