Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439 Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
32 lines
1.0 KiB
PHP
32 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace spec\Gaufrette\Util;
|
|
|
|
use PhpSpec\ObjectBehavior;
|
|
|
|
class PathSpec extends ObjectBehavior
|
|
{
|
|
function it_checks_if_path_is_absolute()
|
|
{
|
|
$this->isAbsolute('/home/path')->shouldBe(true);
|
|
$this->isAbsolute('home/path')->shouldBe(false);
|
|
$this->isAbsolute('../home/path')->shouldBe(false);
|
|
$this->isAbsolute('protocol://home/path')->shouldBe(true);
|
|
}
|
|
|
|
function it_normalizes_file_path()
|
|
{
|
|
$this->normalize('C:\\some\other.txt')->shouldReturn('c:/some/other.txt');
|
|
$this->normalize('..\other.txt')->shouldReturn('../other.txt');
|
|
$this->normalize('..\other.txt')->shouldReturn('../other.txt');
|
|
$this->normalize('/home/other/../new')->shouldReturn('/home/new');
|
|
$this->normalize('/home/other/./new')->shouldReturn('/home/other/new');
|
|
$this->normalize('protocol://home/other.txt')->shouldReturn('protocol://home/other.txt');
|
|
}
|
|
|
|
function it_returns_unix_style_dirname()
|
|
{
|
|
$this->dirname('a/test/path')->shouldReturn('a/test');
|
|
}
|
|
}
|