ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\ResourceStorage\Revision\PathGeneratorTest Class Reference

Class PathGeneratorTest. More...

+ Inheritance diagram for ILIAS\ResourceStorage\Revision\PathGeneratorTest:
+ Collaboration diagram for ILIAS\ResourceStorage\Revision\PathGeneratorTest:

Public Member Functions

 testPathGeneratorV1 ()
 
 testPathGeneratorV2 ()
 
- Public Member Functions inherited from ILIAS\ResourceStorage\AbstractTestBase
 getDummyStream ()
 

Protected Attributes

array $prohibited
 
- Protected Attributes inherited from ILIAS\ResourceStorage\AbstractTestBase
DummyIDGenerator $id_generator
 
MockObject $db_mock
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\ResourceStorage\AbstractTestBase
 setUp ()
 @inheritDoc More...
 
 getDummyUploadResult (string $file_name, string $mime_type, int $size)
 
 getDummyFileRevision (ResourceIdentification $id)
 

Detailed Description

Member Function Documentation

◆ testPathGeneratorV1()

ILIAS\ResourceStorage\Revision\PathGeneratorTest::testPathGeneratorV1 ( )

Definition at line 45 of file PathGeneratorTest.php.

45 : void
46 {
47 $identification_generator = new UniqueIDIdentificationGenerator();
48 $identification = $identification_generator->getUniqueResourceIdentification();
49
50 $path_generator = new UUIDBasedPathGenerator();
51 $path = $path_generator->getPathFor($identification);
52 $this->assertGreaterThanOrEqual(strlen($identification->serialize()), strlen($path));
53 foreach ($this->prohibited as $value) {
54 $this->assertStringNotContainsString((string) $value, $path);
55 }
56
57 $new_identification = $path_generator->getIdentificationFor($path);
58 $this->assertSame($identification->serialize(), $new_identification->serialize());
59 }
$path
Definition: ltiservices.php:30

References $path.

◆ testPathGeneratorV2()

ILIAS\ResourceStorage\Revision\PathGeneratorTest::testPathGeneratorV2 ( )

Definition at line 61 of file PathGeneratorTest.php.

61 : void
62 {
63 $identification_generator = new UniqueIDIdentificationGenerator();
64 $identification = $identification_generator->getUniqueResourceIdentification();
65
66 $path_generator = new MaxNestingPathGenerator();
67 $path = $path_generator->getPathFor($identification);
68
69 foreach ($this->prohibited as $value) {
70 $this->assertStringNotContainsString((string) $value, $path);
71 }
72
73 $new_identification = $path_generator->getIdentificationFor($path);
74 $this->assertSame($identification->serialize(), $new_identification->serialize());
75 }

References $path.

Field Documentation

◆ $prohibited

array ILIAS\ResourceStorage\Revision\PathGeneratorTest::$prohibited
protected
Initial value:
= [
"<",
">",
":",
"\"",
"\\",
"|",
"?",
"*",
]

Definition at line 34 of file PathGeneratorTest.php.


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