@@ -44,6 +44,7 @@ class FactorioExecutionServiceTest extends TestCase
44
44
private ModFileService $ modFileService ;
45
45
private string $ factorioDirectory = 'foo ' ;
46
46
private string $ instancesDirectory = 'bar ' ;
47
+ private string $ logsDirectory = 'baz ' ;
47
48
private string $ version = '1.2.3 ' ;
48
49
49
50
protected function setUp (): void
@@ -69,14 +70,17 @@ private function createInstance(array $mockedMethods = []): FactorioExecutionSer
69
70
$ this ->modFileService ,
70
71
'src ' ,
71
72
'test ' ,
73
+ 'test/asset ' ,
72
74
$ this ->version ,
73
75
])
74
76
->getMock ();
75
77
76
78
$ this ->assertSame (realpath ('src ' ), $ this ->extractProperty ($ instance , 'factorioDirectory ' ));
77
79
$ this ->assertSame (realpath ('test ' ), $ this ->extractProperty ($ instance , 'instancesDirectory ' ));
80
+ $ this ->assertSame (realpath ('test/asset ' ), $ this ->extractProperty ($ instance , 'logsDirectory ' ));
78
81
$ this ->injectProperty ($ instance , 'factorioDirectory ' , $ this ->factorioDirectory );
79
82
$ this ->injectProperty ($ instance , 'instancesDirectory ' , $ this ->instancesDirectory );
83
+ $ this ->injectProperty ($ instance , 'logsDirectory ' , $ this ->logsDirectory );
80
84
81
85
return $ instance ;
82
86
}
@@ -341,6 +345,13 @@ public function testCleanup(): void
341
345
{
342
346
$ combinationId = 'abc ' ;
343
347
348
+ $ this ->fileSystem ->expects ($ this ->once ())
349
+ ->method ('copy ' )
350
+ ->with (
351
+ $ this ->identicalTo ('bar/abc/factorio-current.log ' ),
352
+ $ this ->identicalTo ('baz/factorio_abc.log ' ),
353
+ );
354
+
344
355
$ this ->fileSystem ->expects ($ this ->once ())
345
356
->method ('remove ' )
346
357
->with ($ this ->identicalTo ('bar/abc ' ));
0 commit comments