lithium\tests\cases\core\LibrariesTest::testPathsInPharArchives PHP Method

testPathsInPharArchives() public method

Tests that Libraries::realPath() correctly resolves paths to files inside Phar archives.
    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);
    }