ILIAS  trunk Revision v12.0_alpha-1329-g1094ddb0c33
ILIAS\ResourceStorage\Manager\ContainerManagerTest Class Reference
+ Inheritance diagram for ILIAS\ResourceStorage\Manager\ContainerManagerTest:
+ Collaboration diagram for ILIAS\ResourceStorage\Manager\ContainerManagerTest:

Public Member Functions

 testNormalizePathProducesRelativePath (string $input, string $expected)
 Regression for Mantis 0045580 / 0047237: paths inside ZIP containers must be stored as relative paths without a leading slash. More...
 

Static Public Member Functions

static pathProvider ()
 

Detailed Description

Member Function Documentation

◆ pathProvider()

static ILIAS\ResourceStorage\Manager\ContainerManagerTest::pathProvider ( )
static

Definition at line 45 of file ContainerManagerTest.php.

45 : \Iterator
46 {
47 yield 'file at root, no prefix' => ['index.html', 'index.html'];
48 yield 'file at root, leading slash' => ['/index.html', 'index.html'];
49 yield 'file at root, dot-slash' => ['./index.html', 'index.html'];
50 yield 'file in subdir, no prefix' => ['dir/file.html', 'dir/file.html'];
51 yield 'file in subdir, leading slash' => ['/dir/file.html', 'dir/file.html'];
52 yield 'nested file, leading slash' => ['/assets/css/style.css', 'assets/css/style.css'];
53 yield 'nested file, no prefix' => ['assets/css/style.css', 'assets/css/style.css'];
54 yield 'trailing slash preserved as empty' => ['/', ''];
55 yield 'empty input' => ['', ''];
56 yield 'directory with trailing slash' => ['dir/', 'dir'];
57 yield 'directory with both slashes' => ['/dir/', 'dir'];
58 }

◆ testNormalizePathProducesRelativePath()

ILIAS\ResourceStorage\Manager\ContainerManagerTest::testNormalizePathProducesRelativePath ( string  $input,
string  $expected 
)

Regression for Mantis 0045580 / 0047237: paths inside ZIP containers must be stored as relative paths without a leading slash.

Windows Explorer and other tools hide entries whose names start with "/".

Definition at line 37 of file ContainerManagerTest.php.

37 : void
38 {
39 $manager = (new \ReflectionClass(ContainerManager::class))->newInstanceWithoutConstructor();
40 $method = new \ReflectionMethod(ContainerManager::class, 'normalizePath');
41
42 $this->assertSame($expected, $method->invoke($manager, $input));
43 }

The documentation for this class was generated from the following file: