File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ public function markDirty($path)
226226 // flushing the entire cache
227227 $ path = trim ($ path , '/ ' );
228228 foreach ($ this ->cache as $ nodePath => $ node ) {
229- if ('' === $ path || $ nodePath == $ path || 0 === strpos ($ nodePath , $ path .'/ ' )) {
229+ if ('' === $ path || $ nodePath == $ path || 0 === strpos (( string ) $ nodePath , $ path .'/ ' )) {
230230 unset($ this ->cache [$ nodePath ]);
231231 }
232232 }
Original file line number Diff line number Diff line change @@ -58,6 +58,15 @@ public function testDeepMove()
5858 $ this ->assertTrue ($ tree ->getNodeForPath ('hi/sub ' )->isDeleted );
5959 }
6060
61+ public function testDeepMoveNumber ()
62+ {
63+ $ tree = new TreeMock ();
64+ $ tree ->move ('1/2 ' , 'hi/sub ' );
65+
66+ $ this ->assertArrayHasKey ('sub ' , $ tree ->getNodeForPath ('hi ' )->newDirectories );
67+ $ this ->assertTrue ($ tree ->getNodeForPath ('1/2 ' )->isDeleted );
68+ }
69+
6170 public function testDelete ()
6271 {
6372 $ tree = new TreeMock ();
@@ -114,6 +123,9 @@ public function __construct()
114123 new TreeFileTester ('2 ' ),
115124 new TreeFileTester ('3 ' ),
116125 ]),
126+ new TreeDirectoryTester ('1 ' , [
127+ new TreeDirectoryTester ('2 ' ),
128+ ]),
117129 ])
118130 );
119131 }
@@ -169,7 +181,7 @@ class TreeFileTester extends File implements IProperties
169181{
170182 public $ name ;
171183 public $ data ;
172- public $ properties ;
184+ public $ properties = [] ;
173185
174186 public function __construct ($ name , $ data = null )
175187 {
You can’t perform that action at this time.
0 commit comments