예제 #1
0
 /**
  * Test path operation methods using unicode (UTF-8).
  *
  */
 public function testPathOperationsUnicode()
 {
     $uri = new HTTPURI('http', 'example.net', '/');
     $uri->appendPath('mädchen');
     $this->assertEquals('/mädchen', $uri->getPath());
     $uri->appendPath('/Զիթהתdઅ/');
     $this->assertEquals('/mädchen/Զիթהתdઅ/', $uri->getPath());
     $uri->appendPath('/k%C3%B6nnen/', FALSE);
     $this->assertEquals('/mädchen/Զիթהתdઅ/können/', $uri->getPath());
     $uri->setPath('sûr!');
     $uri->prependPath('%E3%88%B1%E3%82%B0%E3%82%AB%E3%82%9A%E3%84%A4/', FALSE);
     $uri->prependPath('');
     $this->assertEquals('/㈱グカ゚ㄤ/sûr!', $uri->getPath());
     $uri->prependPath('/f̸̪̫̫̮͐̽̓͂d/');
     $uri->prependPath('/');
     $uri->appendPath('/');
     $this->assertEquals('/f̸̪̫̫̮͐̽̓͂d/㈱グカ゚ㄤ/sûr!/', $uri->getPath());
     $this->assertEquals('/f̸̪̫̫̮͐̽̓͂d/㈱グカ゚ㄤ/sûr!/', $uri->getPathWithoutBase(''));
     $this->assertEquals('/f̸̪̫̫̮͐̽̓͂d/㈱グカ゚ㄤ/sûr!/', $uri->getPathWithoutBase('bar/baz/'));
     $this->assertEquals('/', $uri->getPathWithoutBase('/f̸̪̫̫̮͐̽̓͂d/㈱グカ゚ㄤ/sûr!/'));
     $this->assertEquals('/㈱グカ゚ㄤ/sûr!/', $uri->getpathWithoutBase('f̸̪̫̫̮͐̽̓͂d'));
     $this->assertEquals('/㈱グカ゚ㄤ/sûr!/', $uri->getpathWithoutBase('f%CC%AA%CC%AB%CD%90%CC%B8%CC%AB%CC%AE%CC%BD%CD%83%CD%82d', FALSE));
     $this->assertEquals('/sûr!/', $uri->getPathWithoutBase('f̸̪̫̫̮͐̽̓͂d/㈱グカ゚ㄤ/'));
     $this->assertEquals('/sûr!/', $uri->getPathWithoutBase('/f̸̪̫̫̮͐̽̓͂d/㈱グカ゚ㄤ/'));
 }