@@ -24,6 +24,7 @@ public function testGetStorage()
24
24
$ config = m::mock (Config::class);
25
25
$ config ->shouldReceive ('get ' )->with ('lfm.driver ' )->once ()->andReturn ('file ' );
26
26
$ config ->shouldReceive ('get ' )->with ('lfm.driver ' )->once ()->andReturn ('storage ' );
27
+ $ config ->shouldReceive ('get ' )->with ('lfm.disk ' )->once ()->andReturn ('local ' );
27
28
28
29
$ lfm1 = new Lfm ($ config );
29
30
$ lfm2 = new Lfm ($ config );
@@ -41,18 +42,6 @@ public function testInput()
41
42
$ this ->assertEquals ('bar ' , $ lfm ->input ('foo ' ));
42
43
}
43
44
44
- public function testIsProcessingImages ()
45
- {
46
- $ request = m::mock (Request::class);
47
- $ request ->shouldReceive ('input ' )->with ('type ' )->once ()->andReturn ('image ' );
48
- $ request ->shouldReceive ('input ' )->with ('type ' )->once ()->andReturn ('file ' );
49
-
50
- $ lfm = new Lfm (m::mock (Config::class), $ request );
51
-
52
- $ this ->assertTrue ($ lfm ->isProcessingImages ());
53
- $ this ->assertFalse ($ lfm ->isProcessingImages ());
54
- }
55
-
56
45
public function testGetNameFromPath ()
57
46
{
58
47
$ this ->assertEquals ('bar ' , (new Lfm )->getNameFromPath ('foo/bar ' ));
@@ -84,6 +73,9 @@ public function testGetCategoryName()
84
73
->with ('lfm.folder_categories.image.folder_name ' , m::type ('string ' ))
85
74
->once ()
86
75
->andReturn ('photos ' );
76
+ $ config ->shouldReceive ('get ' )
77
+ ->with ('lfm.folder_categories ' )
78
+ ->andReturn (['file ' => [], 'image ' => []]);
87
79
88
80
$ request = m::mock (Request::class);
89
81
$ request ->shouldReceive ('input ' )->with ('type ' )->once ()->andReturn ('file ' );
@@ -100,11 +92,18 @@ public function testCurrentLfmType()
100
92
$ request = m::mock (Request::class);
101
93
$ request ->shouldReceive ('input ' )->with ('type ' )->once ()->andReturn ('file ' );
102
94
$ request ->shouldReceive ('input ' )->with ('type ' )->once ()->andReturn ('image ' );
95
+ $ request ->shouldReceive ('input ' )->with ('type ' )->once ()->andReturn ('foo ' );
103
96
104
- $ lfm = new Lfm (m::mock (Config::class), $ request );
97
+ $ config = m::mock (Config::class);
98
+ $ config ->shouldReceive ('get ' )
99
+ ->with ('lfm.folder_categories ' )
100
+ ->andReturn (['file ' => [], 'image ' => []]);
101
+
102
+ $ lfm = new Lfm ($ config , $ request );
105
103
106
104
$ this ->assertEquals ('file ' , $ lfm ->currentLfmType ());
107
105
$ this ->assertEquals ('image ' , $ lfm ->currentLfmType ());
106
+ $ this ->assertEquals ('file ' , $ lfm ->currentLfmType ());
108
107
}
109
108
110
109
public function testGetUserSlug ()
0 commit comments