public testPathsInPharArchives ( ) |
public function testPathsInPharArchives()
{
$this->skipIf(!Phar::canWrite(), '`Phar support is read only.');
$path = realpath(Libraries::get(true, 'resources') . '/tmp/tests');
$file = $path . '/test.phar';
$phar = new Phar($file);
$phar->addFromString('/controllers/HelloWorldController.php', '<?php "Hello World" ?>');
$expected = "phar://{$file}/controllers/HelloWorldController.php";
$result = Libraries::realPath($expected);
$this->assertEqual($expected, $result);
unset($phar);
unlink($file);
}