@@ -75,54 +75,99 @@ public function testRun() {
7575 ->getMock ();
7676
7777 $ fs ->expects ($ this ->at (0 ))
78- ->method ('remove ' )
79- ->with ('dir6 ' );
78+ ->method ('chmod ' )
79+ ->with ('dir1 ' , 0777 , 0000 , true );
8080 $ fs ->expects ($ this ->at (1 ))
8181 ->method ('remove ' )
82- ->with ('dir7 ' );
82+ ->with ('dir1 ' );
8383 $ fs ->expects ($ this ->at (2 ))
84- ->method ('remove ' )
85- ->with ('dir8 ' );
84+ ->method ('chmod ' )
85+ ->with ('dir2 ' , 0777 , 0000 , true );
8686 $ fs ->expects ($ this ->at (3 ))
8787 ->method ('remove ' )
88- ->with ('dir9 ' );
88+ ->with ('dir2 ' );
8989 $ fs ->expects ($ this ->at (4 ))
90- ->method ('remove ' )
91- ->with ('dir10 ' );
90+ ->method ('chmod ' )
91+ ->with ('dir3 ' , 0777 , 0000 , true );
9292 $ fs ->expects ($ this ->at (5 ))
9393 ->method ('remove ' )
94- ->with ('dir11 ' );
95-
96- // Delete items in path/to/dir2.
94+ ->with ('dir3 ' );
9795 $ fs ->expects ($ this ->at (6 ))
98- ->method ('remove ' )
99- ->with ('dir4 ' );
96+ ->method ('chmod ' )
97+ ->with ('dir4 ' , 0777 , 0000 , true );
10098 $ fs ->expects ($ this ->at (7 ))
10199 ->method ('remove ' )
102- ->with ('dir5 ' );
100+ ->with ('dir4 ' );
103101 $ fs ->expects ($ this ->at (8 ))
104- ->method ('remove ' )
105- ->with ('dir6 ' );
102+ ->method ('chmod ' )
103+ ->with ('dir5 ' , 0777 , 0000 , true );
106104 $ fs ->expects ($ this ->at (9 ))
107105 ->method ('remove ' )
108- ->with ('dir7 ' );
106+ ->with ('dir5 ' );
109107 $ fs ->expects ($ this ->at (10 ))
110- ->method ('remove ' )
111- ->with ('dir8 ' );
108+ ->method ('chmod ' )
109+ ->with ('dir6 ' , 0777 , 0000 , true );
112110 $ fs ->expects ($ this ->at (11 ))
113111 ->method ('remove ' )
114- ->with ('dir9 ' );
112+ ->with ('dir6 ' );
113+
114+ // Delete items in path/to/dir2.
115115 $ fs ->expects ($ this ->at (12 ))
116- ->method ('remove ' )
117- ->with ('dir10 ' );
116+ ->method ('chmod ' )
117+ ->with ('dir1 ' , 0777 , 0000 , true );
118118 $ fs ->expects ($ this ->at (13 ))
119119 ->method ('remove ' )
120- ->with ('dir11 ' );
120+ ->with ('dir1 ' );
121+ $ fs ->expects ($ this ->at (14 ))
122+ ->method ('chmod ' )
123+ ->with ('dir2 ' , 0777 , 0000 , true );
124+ $ fs ->expects ($ this ->at (15 ))
125+ ->method ('remove ' )
126+ ->with ('dir2 ' );
127+ $ fs ->expects ($ this ->at (16 ))
128+ ->method ('chmod ' )
129+ ->with ('dir3 ' , 0777 , 0000 , true );
130+ $ fs ->expects ($ this ->at (17 ))
131+ ->method ('remove ' )
132+ ->with ('dir3 ' );
133+ $ fs ->expects ($ this ->at (18 ))
134+ ->method ('chmod ' )
135+ ->with ('dir4 ' , 0777 , 0000 , true );
136+ $ fs ->expects ($ this ->at (19 ))
137+ ->method ('remove ' )
138+ ->with ('dir4 ' );
139+ $ fs ->expects ($ this ->at (20 ))
140+ ->method ('chmod ' )
141+ ->with ('dir5 ' , 0777 , 0000 , true );
142+ $ fs ->expects ($ this ->at (21 ))
143+ ->method ('remove ' )
144+ ->with ('dir5 ' );
145+ $ fs ->expects ($ this ->at (22 ))
146+ ->method ('chmod ' )
147+ ->with ('dir6 ' , 0777 , 0000 , true );
148+ $ fs ->expects ($ this ->at (23 ))
149+ ->method ('remove ' )
150+ ->with ('dir6 ' );
151+ $ fs ->expects ($ this ->at (24 ))
152+ ->method ('chmod ' )
153+ ->with ('dir7 ' , 0777 , 0000 , true );
154+ $ fs ->expects ($ this ->at (25 ))
155+ ->method ('remove ' )
156+ ->with ('dir7 ' );
157+ $ fs ->expects ($ this ->at (26 ))
158+ ->method ('chmod ' )
159+ ->with ('dir8 ' , 0777 , 0000 , true );
160+ $ fs ->expects ($ this ->at (27 ))
161+ ->method ('remove ' )
162+ ->with ('dir8 ' );
121163
122164 // Delete items in path/to/dir3.
123- $ fs ->expects ($ this ->at (14 ))
165+ $ fs ->expects ($ this ->at (28 ))
166+ ->method ('chmod ' )
167+ ->with ('dir1 ' , 0777 , 0000 , true );
168+ $ fs ->expects ($ this ->at (29 ))
124169 ->method ('remove ' )
125- ->with ('dir11 ' );
170+ ->with ('dir1 ' );
126171
127172 $ result = $ this ->taskPartialCleanDirs ($ dirs , $ finder , $ fs )
128173 ->run ();
0 commit comments