ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
FlySystemLocalFilesystemFactoryTestTBD.php
Go to the documentation of this file.
1 <?php
2 
20 
27 
33 {
35 
37 
38 
43  protected function setUp(): void
44  {
45  parent::setUp();
46 
47  $this->subject = new FlySystemLocalFilesystemFactory();
48  }
49 
50  #[Test]
51 
53  {
54  $rootPath = __DIR__;
55 
56  $privateAccessFile = 0700;
57  $privateAccessDir = 0700;
58 
59  $publicAccessFile = 0744;
60  $publicAccessDir = 0755;
61  $lockMode = LOCK_EX;
62 
63  $config = new LocalConfig(
64  $rootPath,
65  $publicAccessFile,
66  $privateAccessFile,
67  $publicAccessDir,
68  $privateAccessDir,
69  $lockMode,
71  );
72 
73  $filesystem = $this->subject->getInstance($config);
74  $this->assertInstanceOf(FilesystemFacade::class, $filesystem, "Filesystem type must be " . FilesystemFacade::class);
75  }
76 
77  #[Test]
78 
80  {
81  $rootPath = __DIR__;
82 
83  $privateAccessFile = 0700;
84  $privateAccessDir = 0700;
85 
86  $publicAccessFile = 0744;
87  $publicAccessDir = 0755;
88  $lockMode = LOCK_EX;
89  $invalidLinkBehaviour = 9999;
90 
91  $config = new LocalConfig(
92  $rootPath,
93  $publicAccessFile,
94  $privateAccessFile,
95  $publicAccessDir,
96  $privateAccessDir,
97  $lockMode,
98  $invalidLinkBehaviour
99  );
100 
101  $this->expectException(\InvalidArgumentException::class);
102  $this->expectExceptionMessage("The supplied value \"$invalidLinkBehaviour\" is not a valid LocalConfig link behaviour constant.");
103 
104  $this->subject->getInstance($config);
105  }
106 
107  #[Test]
108 
110  {
111  $rootPath = __DIR__;
112 
113  $privateAccessFile = 0700;
114  $privateAccessDir = 0700;
115 
116  $publicAccessFile = 0744;
117  $publicAccessDir = 0755;
118  $invalidLockMode = 9999;
119 
120  $config = new LocalConfig(
121  $rootPath,
122  $publicAccessFile,
123  $privateAccessFile,
124  $publicAccessDir,
125  $privateAccessDir,
126  $invalidLockMode,
128  );
129 
130  $this->expectException(\InvalidArgumentException::class);
131  $this->expectExceptionMessage("The supplied value \"$invalidLockMode\" is not a valid file lock mode please check your local file storage configurations.");
132 
133  $this->subject->getInstance($config);
134  }
135 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class is used to configure the local filesystem adapter.
Definition: LocalConfig.php:29