File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Tests \Unit \Commands ;
6
+
7
+ use Tests \BaseTestCase ;
8
+ use Tests \Unit \FileManager \ExtractTest ;
9
+ use WP_CLI_Secure \FileManager ;
10
+ use WP_CLI_Secure \SubCommands \BlockAccessToHtaccess ;
11
+
12
+ class SubCommandTest extends BaseTestCase {
13
+
14
+ public function testItWillSetCorrectCommandArguments () : void {
15
+ $ assocArgs = [
16
+ 'file-path ' => $ this ->root ->url () . '/.htaccess ' ,
17
+ 'server ' => 'nginx ' ,
18
+ 'output ' => true
19
+ ];
20
+
21
+ $ command = new BlockAccessToHtaccess ($ assocArgs );
22
+
23
+ $ this ->assertEquals ($ assocArgs ['file-path ' ], $ command ->filePath );
24
+ $ this ->assertEquals ($ assocArgs ['server ' ], $ command ->serverType );
25
+ $ this ->assertEquals ($ assocArgs ['output ' ], $ command ->output );
26
+
27
+ $ assocArgs = [];
28
+
29
+ $ command = new BlockAccessToHtaccess ($ assocArgs );
30
+
31
+ $ this ->assertEquals ('.htaccess ' , $ command ->filePath );
32
+ $ this ->assertEquals ('apache ' , $ command ->serverType );
33
+ $ this ->assertFalse ($ command ->output );
34
+ }
35
+ }
You can’t perform that action at this time.
0 commit comments