Class LegacyPathHelperTest.
More...
◆ setUp()
ILIAS\Filesystem\Util\LegacyPathHelperTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 51 of file LegacyPathHelperTest.php.
References $clientId, $GLOBALS, $iliasAbsolutePath, CLIENT_DATA_DIR, and CLIENT_WEB_DIR.
56 $dataDir =
'/dummy/var/www/ildata';
61 define(
"CLIENT_DATA_DIR", $dataDir .
'/' .
$clientId);
64 define(
"ILIAS_WEB_DIR", $webDir);
65 define(
"CLIENT_ID",
'default');
71 $this->tempPath = sys_get_temp_dir();
74 $this->filesystemsMock = \Mockery::mock(Filesystems::class);
76 $containerMock = Mockery::mock(Container::class);
77 $containerMock->shouldReceive(
'filesystem')
80 ->andReturn($this->filesystemsMock);
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
◆ testCreateRelativePathWithInvalidTargetWhichShouldFail()
ILIAS\Filesystem\Util\LegacyPathHelperTest::testCreateRelativePathWithInvalidTargetWhichShouldFail |
( |
| ) |
|
Definition at line 204 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\createRelativePath().
206 $target =
'/invalid/path/to/target';
208 $this->expectException(\InvalidArgumentException::class);
209 $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 143 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\deriveFilesystemFrom().
145 $target = $this->libsPath .
'libs/bower/bower_components/mediaelement/build';
147 $this->filesystemsMock
148 ->shouldReceive(
'libs')
150 ->andReturn(Mockery::mock(Filesystem::class));
153 $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 161 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\deriveFilesystemFrom().
163 $target =
'/invalid/path/to/testtarget';
165 $this->expectException(\InvalidArgumentException::class);
166 $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 126 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\deriveFilesystemFrom().
128 $target =
'./libs/bower/bower_components/mediaelement/build';
130 $this->filesystemsMock
131 ->shouldReceive(
'libs')
133 ->andReturn(Mockery::mock(Filesystem::class));
136 $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 108 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\deriveFilesystemFrom().
110 $target = $this->storagePath .
'/testtarget';
112 $this->filesystemsMock
113 ->shouldReceive(
'storage')
115 ->andReturn(Mockery::mock(Filesystem::class));
118 $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 90 of file LegacyPathHelperTest.php.
References ILIAS\Filesystem\Util\LegacyPathHelper\deriveFilesystemFrom().
92 $target = $this->webPath .
'/testtarget';
94 $this->filesystemsMock
95 ->shouldReceive(
'web')
97 ->andReturn(Mockery::mock(Filesystem::class));
100 $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: