Class LegacyPathHelperTest.
More...
◆ setUp()
ILIAS\Filesystem\Util\LegacyPathHelperTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 40 of file LegacyPathHelperTest.php.
References $GLOBALS, $iliasAbsolutePath, CLIENT_DATA_DIR, and CLIENT_WEB_DIR.
45 $dataDir =
'/dummy/var/www/ildata';
47 $clientId =
'default';
50 define(
"CLIENT_DATA_DIR", $dataDir .
'/' . $clientId);
53 define(
"ILIAS_WEB_DIR", $webDir);
54 define(
"CLIENT_ID",
'default');
60 $this->tempPath = sys_get_temp_dir();
63 $this->filesystemsMock = \Mockery::mock(Filesystems::class);
65 $containerMock = Mockery::mock(Container::class);
66 $containerMock->shouldReceive(
'filesystem')
69 ->andReturn($this->filesystemsMock);
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
◆ testCreateRelativePathWithInvalidTargetWhichShouldFail()
ILIAS\Filesystem\Util\LegacyPathHelperTest::testCreateRelativePathWithInvalidTargetWhichShouldFail |
( |
| ) |
|
Definition at line 193 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\createRelativePath().
195 $target =
'/invalid/path/to/target';
197 $this->expectException(\InvalidArgumentException::class);
198 $this->expectExceptionMessage(
"Invalid path supplied. Path must start with the web, storage, temp, customizing or libs storage location. Path given: '{$target}'");
static createRelativePath(string $absolute_path)
Creates a relative path from an absolute path which starts with a valid storage location.
◆ testCreateRelativePathWithStorageTargetWhichShouldSucceed()
ILIAS\Filesystem\Util\LegacyPathHelperTest::testCreateRelativePathWithStorageTargetWhichShouldSucceed |
( |
| ) |
|
◆ testCreateRelativePathWithWebTargetWhichShouldSucceed()
ILIAS\Filesystem\Util\LegacyPathHelperTest::testCreateRelativePathWithWebTargetWhichShouldSucceed |
( |
| ) |
|
◆ testDeriveFilesystemFromWithAbsoluteLibsTargetWhichShouldSucceed()
ILIAS\Filesystem\Util\LegacyPathHelperTest::testDeriveFilesystemFromWithAbsoluteLibsTargetWhichShouldSucceed |
( |
| ) |
|
Definition at line 132 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\deriveFilesystemFrom().
134 $target = $this->libsPath .
'libs/bower/bower_components/mediaelement/build';
136 $this->filesystemsMock
137 ->shouldReceive(
'libs')
139 ->andReturn(Mockery::mock(Filesystem::class));
142 $this->assertTrue($filesystem instanceof
Filesystem,
'Expecting filesystem instance.');
static deriveFilesystemFrom(string $absolute_path)
Tries to fetch the filesystem responsible for the absolute path.
Class FlySystemFileAccessTest disabled disabled disabled.
◆ testDeriveFilesystemFromWithInvalidTargetWhichShouldFail()
ILIAS\Filesystem\Util\LegacyPathHelperTest::testDeriveFilesystemFromWithInvalidTargetWhichShouldFail |
( |
| ) |
|
Definition at line 150 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\deriveFilesystemFrom().
152 $target =
'/invalid/path/to/testtarget';
154 $this->expectException(\InvalidArgumentException::class);
155 $this->expectExceptionMessage(
"Invalid path supplied. Path must start with the web, storage, temp, customizing or libs storage location. Path given: '{$target}'");
static deriveFilesystemFrom(string $absolute_path)
Tries to fetch the filesystem responsible for the absolute path.
◆ testDeriveFilesystemFromWithRelativeLibsTargetWhichShouldSucceed()
ILIAS\Filesystem\Util\LegacyPathHelperTest::testDeriveFilesystemFromWithRelativeLibsTargetWhichShouldSucceed |
( |
| ) |
|
Definition at line 115 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\deriveFilesystemFrom().
117 $target =
'./libs/bower/bower_components/mediaelement/build';
119 $this->filesystemsMock
120 ->shouldReceive(
'libs')
122 ->andReturn(Mockery::mock(Filesystem::class));
125 $this->assertTrue($filesystem instanceof
Filesystem,
'Expecting filesystem instance.');
static deriveFilesystemFrom(string $absolute_path)
Tries to fetch the filesystem responsible for the absolute path.
Class FlySystemFileAccessTest disabled disabled disabled.
◆ testDeriveFilesystemFromWithStorageTargetWhichShouldSucceed()
ILIAS\Filesystem\Util\LegacyPathHelperTest::testDeriveFilesystemFromWithStorageTargetWhichShouldSucceed |
( |
| ) |
|
Definition at line 97 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\deriveFilesystemFrom().
99 $target = $this->storagePath .
'/testtarget';
101 $this->filesystemsMock
102 ->shouldReceive(
'storage')
104 ->andReturn(Mockery::mock(Filesystem::class));
107 $this->assertTrue($filesystem instanceof
Filesystem,
'Expecting filesystem instance.');
static deriveFilesystemFrom(string $absolute_path)
Tries to fetch the filesystem responsible for the absolute path.
Class FlySystemFileAccessTest disabled disabled disabled.
◆ testDeriveFilesystemFromWithWebTargetWhichShouldSucceed()
ILIAS\Filesystem\Util\LegacyPathHelperTest::testDeriveFilesystemFromWithWebTargetWhichShouldSucceed |
( |
| ) |
|
Definition at line 79 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\deriveFilesystemFrom().
81 $target = $this->webPath .
'/testtarget';
83 $this->filesystemsMock
84 ->shouldReceive(
'web')
86 ->andReturn(Mockery::mock(Filesystem::class));
89 $this->assertTrue($filesystem instanceof
Filesystem,
'Expecting filesystem instance.');
static deriveFilesystemFrom(string $absolute_path)
Tries to fetch the filesystem responsible for the absolute path.
Class FlySystemFileAccessTest disabled disabled disabled.
◆ $customizingPath
ILIAS\Filesystem\Util\LegacyPathHelperTest::$customizingPath |
|
private |
◆ $filesystemsMock
MockInterface Filesystems ILIAS\Filesystem\Util\LegacyPathHelperTest::$filesystemsMock |
|
private |
◆ $libsPath
ILIAS\Filesystem\Util\LegacyPathHelperTest::$libsPath |
|
private |
◆ $storagePath
ILIAS\Filesystem\Util\LegacyPathHelperTest::$storagePath |
|
private |
◆ $tempPath
ILIAS\Filesystem\Util\LegacyPathHelperTest::$tempPath |
|
private |
◆ $webPath
ILIAS\Filesystem\Util\LegacyPathHelperTest::$webPath |
|
private |
The documentation for this class was generated from the following file: