ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
FlySystemLocalFilesystemFactoryTest.php
Go to the documentation of this file.
1 <?php
2 
4 
5 require_once('./libs/composer/vendor/autoload.php');
6 
11 
23 {
25 
29  private $subject;
30 
31 
36  protected function setUp()
37  {
38  parent::setUp();
39 
40  $this->subject = new FlySystemLocalFilesystemFactory();
41  }
42 
48  {
49  $rootPath = __DIR__;
50 
51  $privateAccessFile = 0700;
52  $privateAccessDir = 0700;
53 
54  $publicAccessFile = 0744;
55  $publicAccessDir = 0755;
56  $lockMode = LOCK_EX;
57 
58  $config = new LocalConfig(
59  $rootPath,
60  $publicAccessFile,
61  $privateAccessFile,
62  $publicAccessDir,
63  $privateAccessDir,
64  $lockMode,
66  );
67 
68  $filesystem = $this->subject->getInstance($config);
69  $this->assertInstanceOf(FilesystemFacade::class, $filesystem, "Filesystem type must be " . FilesystemFacade::class);
70  }
71 
77  {
78  $rootPath = __DIR__;
79 
80  $privateAccessFile = 0700;
81  $privateAccessDir = 0700;
82 
83  $publicAccessFile = 0744;
84  $publicAccessDir = 0755;
85  $lockMode = LOCK_EX;
86  $invalidLinkBehaviour = 9999;
87 
88  $config = new LocalConfig(
89  $rootPath,
90  $publicAccessFile,
91  $privateAccessFile,
92  $publicAccessDir,
93  $privateAccessDir,
94  $lockMode,
95  $invalidLinkBehaviour
96  );
97 
98  $this->expectException(\InvalidArgumentException::class);
99  $this->expectExceptionMessage("The supplied value \"$invalidLinkBehaviour\" is not a valid LocalConfig link behaviour constant.");
100 
101  $this->subject->getInstance($config);
102  }
103 
109  {
110  $rootPath = __DIR__;
111 
112  $privateAccessFile = 0700;
113  $privateAccessDir = 0700;
114 
115  $publicAccessFile = 0744;
116  $publicAccessDir = 0755;
117  $invalidLockMode = 9999;
118 
119  $config = new LocalConfig(
120  $rootPath,
121  $publicAccessFile,
122  $privateAccessFile,
123  $publicAccessDir,
124  $privateAccessDir,
125  $invalidLockMode,
127  );
128 
129  $this->expectException(\InvalidArgumentException::class);
130  $this->expectExceptionMessage("The supplied value \"$invalidLockMode\" is not a valid file lock mode please check your local file storage configurations.");
131 
132  $this->subject->getInstance($config);
133  }
134 }
setUp()
Sets up the fixture, for example, open a network connection.