File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 11<?php namespace Tests \Routes ;
22use \Tests \StatementsTestCase as StatementsTestCase ;
3+ use \Locker \Helpers \Helpers as Helpers ;
34
45class StatementAttachmentTest extends StatementsTestCase {
56 use RouteTestTrait;
@@ -104,8 +105,23 @@ public function testIndexAttachments() {
104105 $ this ->assertEquals ($ actual_hash , $ expected_hash );
105106 }
106107
108+ private function deleteDirectory ($ dir ) {
109+ array_map (function ($ file ) {
110+ if (is_dir ($ file )) {
111+ $ this ->deleteDirectory ($ file );
112+ } else {
113+ unlink ($ file );
114+ }
115+ }, glob ($ dir . '* ' , GLOB_MARK ));
116+ if (is_dir ($ dir )) {
117+ rmdir ($ dir );
118+ }
119+ }
120+
107121 public function tearDown () {
108122 parent ::tearDown ();
123+ $ dir = Helpers::getEnvVar ('LOCAL_FILESTORE ' ).'/ ' .$ this ->lrs ->_id ;
124+ $ this ->deleteDirectory ($ dir );
109125 (new \Statement )
110126 ->where ('lrs._id ' , $ this ->lrs ->_id )
111127 ->delete ();
You can’t perform that action at this time.
0 commit comments