/**
  * @param string $strIn
  * @param string $strOut
  * @param string $booTrue
  *
  * @covers Etechnika\IdnaConvert\IdnaConvert::decodeString
  * @dataProvider providerDecodeString
  */
 public function testDecodeString($strIn, $strOut, $booTrue)
 {
     if ($booTrue) {
         $strOut === IdnaConvert::decodeString($strIn) ? $this->assertTrue(true) : $this->assertFalse(false);
     } else {
         $strOut !== IdnaConvert::decodeString($strIn) ? $this->assertTrue(true) : $this->assertFalse(false);
     }
 }
Example #2
0
 /**
  *
  * @return string 
  */
 public function getRoot()
 {
     $rawRootUrl = '';
     if ($this->hasScheme()) {
         $rawRootUrl .= $this->getScheme() . ':';
     }
     if ($this->hasHost()) {
         $rawRootUrl .= '//';
         if ($this->hasCredentials()) {
             $rawRootUrl .= $this->getCredentials() . '@';
         }
         $host = (string) $this->getHost();
         if ($this->getConfiguration()->getConvertIdnToUtf8()) {
             $host = \Etechnika\IdnaConvert\IdnaConvert::decodeString($host);
         }
         $rawRootUrl .= $host;
     }
     if ($this->hasPort()) {
         $rawRootUrl .= ':' . $this->getPort();
     }
     return $rawRootUrl;
 }
Example #3
0
 /**
  * Decode domain name
  *
  * @param string $strDomainName
  *
  * @return string
  */
 public static function idnaDecode($strDomainName)
 {
     return IdnaConvert::decodeString($strDomainName);
 }
 function decode($str)
 {
     return IdnaConvert::decodeString($str);
 }