1212
1313class LfmTest extends TestCase
1414{
15- public function tearDown ()
15+ public function tearDown (): void
1616 {
1717 m::close ();
1818
@@ -50,8 +50,13 @@ public function testAllowFolderType()
5050 $ config ->shouldReceive ('get ' )->with ('lfm.allow_private_folder ' )->once ()->andReturn (false );
5151 $ config ->shouldReceive ('get ' )->with ('lfm.allow_private_folder ' )->once ()->andReturn (true );
5252 $ config ->shouldReceive ('get ' )->with ('lfm.allow_shared_folder ' )->once ()->andReturn (false );
53+ $ config ->shouldReceive ('get ' )->with ('lfm.folder_categories ' )->andReturn ([]);
54+ $ config ->shouldReceive ('has ' )->andReturn (false );
5355
54- $ lfm = new Lfm ($ config );
56+ $ request = m::mock (Request::class);
57+ $ request ->shouldReceive ('input ' )->with ('type ' )->andReturn ('' );
58+
59+ $ lfm = new Lfm ($ config , $ request );
5560
5661 $ this ->assertTrue ($ lfm ->allowFolderType ('user ' ));
5762 $ this ->assertTrue ($ lfm ->allowFolderType ('shared ' ));
@@ -155,8 +160,13 @@ public function testAllowMultiUser()
155160 {
156161 $ config = m::mock (Config::class);
157162 $ config ->shouldReceive ('get ' )->with ('lfm.allow_private_folder ' )->once ()->andReturn (true );
163+ $ config ->shouldReceive ('get ' )->with ('lfm.folder_categories ' )->andReturn ([]);
164+ $ config ->shouldReceive ('has ' )->andReturn (false );
158165
159- $ lfm = new Lfm ($ config );
166+ $ request = m::mock (Request::class);
167+ $ request ->shouldReceive ('input ' )->with ('type ' )->andReturn ('' );
168+
169+ $ lfm = new Lfm ($ config , $ request );
160170
161171 $ this ->assertTrue ($ lfm ->allowMultiUser ());
162172 }
@@ -167,8 +177,13 @@ public function testAllowShareFolder()
167177 $ config ->shouldReceive ('get ' )->with ('lfm.allow_private_folder ' )->once ()->andReturn (false );
168178 $ config ->shouldReceive ('get ' )->with ('lfm.allow_private_folder ' )->once ()->andReturn (true );
169179 $ config ->shouldReceive ('get ' )->with ('lfm.allow_shared_folder ' )->once ()->andReturn (false );
180+ $ config ->shouldReceive ('get ' )->with ('lfm.folder_categories ' )->andReturn ([]);
181+ $ config ->shouldReceive ('has ' )->andReturn (false );
170182
171- $ lfm = new Lfm ($ config );
183+ $ request = m::mock (Request::class);
184+ $ request ->shouldReceive ('input ' )->with ('type ' )->andReturn ('' );
185+
186+ $ lfm = new Lfm ($ config , $ request );
172187
173188 $ this ->assertTrue ($ lfm ->allowShareFolder ());
174189 $ this ->assertFalse ($ lfm ->allowShareFolder ());
0 commit comments