1111use OC \Core \Command \Maintenance \Mimetype \GenerateMimetypeFileBuilder ;
1212use OC \Files \Type \Detection ;
1313use OC \IntegrityCheck \Checker ;
14- use OC \IntegrityCheck \Helpers \AppLocator ;
1514use OC \IntegrityCheck \Helpers \EnvironmentHelper ;
1615use OC \IntegrityCheck \Helpers \FileAccessHelper ;
1716use OC \Memcache \NullCache ;
@@ -29,10 +28,6 @@ class CheckerTest extends TestCase {
2928 private $ serverVersion ;
3029 /** @var EnvironmentHelper|\PHPUnit\Framework\MockObject\MockObject */
3130 private $ environmentHelper ;
32- /** @var AppLocator|\PHPUnit\Framework\MockObject\MockObject */
33- private $ appLocator ;
34- /** @var Checker */
35- private $ checker ;
3631 /** @var FileAccessHelper|\PHPUnit\Framework\MockObject\MockObject */
3732 private $ fileAccessHelper ;
3833 /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
@@ -46,12 +41,13 @@ class CheckerTest extends TestCase {
4641 /** @var \OC\Files\Type\Detection|\PHPUnit\Framework\MockObject\MockObject */
4742 private $ mimeTypeDetector ;
4843
44+ private Checker $ checker ;
45+
4946 protected function setUp (): void {
5047 parent ::setUp ();
5148 $ this ->serverVersion = $ this ->createMock (ServerVersion::class);
5249 $ this ->environmentHelper = $ this ->createMock (EnvironmentHelper::class);
5350 $ this ->fileAccessHelper = $ this ->createMock (FileAccessHelper::class);
54- $ this ->appLocator = $ this ->createMock (AppLocator::class);
5551 $ this ->config = $ this ->createMock (IConfig::class);
5652 $ this ->appConfig = $ this ->createMock (IAppConfig::class);
5753 $ this ->cacheFactory = $ this ->createMock (ICacheFactory::class);
@@ -71,7 +67,6 @@ protected function setUp(): void {
7167 $ this ->serverVersion ,
7268 $ this ->environmentHelper ,
7369 $ this ->fileAccessHelper ,
74- $ this ->appLocator ,
7570 $ this ->config ,
7671 $ this ->appConfig ,
7772 $ this ->cacheFactory ,
@@ -186,7 +181,7 @@ public function testVerifyAppSignatureWithValidSignatureData(): void {
186181 ->with ('integrity.check.disabled ' , false )
187182 ->willReturn (false );
188183
189- $ this ->appLocator
184+ $ this ->appManager
190185 ->expects ($ this ->once ())
191186 ->method ('getAppPath ' )
192187 ->with ('SomeApp ' )
@@ -221,7 +216,7 @@ public function testVerifyAppSignatureWithTamperedSignatureData(): void {
221216 ->with ('integrity.check.disabled ' , false )
222217 ->willReturn (false );
223218
224- $ this ->appLocator
219+ $ this ->appManager
225220 ->expects ($ this ->once ())
226221 ->method ('getAppPath ' )
227222 ->with ('SomeApp ' )
@@ -262,7 +257,7 @@ public function testVerifyAppSignatureWithTamperedFiles(): void {
262257 ->with ('integrity.check.disabled ' , false )
263258 ->willReturn (false );
264259
265- $ this ->appLocator
260+ $ this ->appManager
266261 ->expects ($ this ->once ())
267262 ->method ('getAppPath ' )
268263 ->with ('SomeApp ' )
@@ -319,7 +314,7 @@ public function testVerifyAppSignatureWithTamperedFilesAndAlternatePath(): void
319314 ->with ('integrity.check.disabled ' , false )
320315 ->willReturn (false );
321316
322- $ this ->appLocator
317+ $ this ->appManager
323318 ->expects ($ this ->never ())
324319 ->method ('getAppPath ' )
325320 ->with ('SomeApp ' );
@@ -374,7 +369,7 @@ public function testVerifyAppWithDifferentScope(): void {
374369 ->with ('integrity.check.disabled ' , false )
375370 ->willReturn (false );
376371
377- $ this ->appLocator
372+ $ this ->appManager
378373 ->expects ($ this ->once ())
379374 ->method ('getAppPath ' )
380375 ->with ('SomeApp ' )
@@ -415,7 +410,7 @@ public function testVerifyAppWithDifferentScopeAndAlwaysTrustedCore(): void {
415410 ->with ('integrity.check.disabled ' , false )
416411 ->willReturn (false );
417412
418- $ this ->appLocator
413+ $ this ->appManager
419414 ->expects ($ this ->once ())
420415 ->method ('getAppPath ' )
421416 ->with ('SomeApp ' )
@@ -984,7 +979,6 @@ public function testRunInstanceVerification(): void {
984979 $ this ->serverVersion ,
985980 $ this ->environmentHelper ,
986981 $ this ->fileAccessHelper ,
987- $ this ->appLocator ,
988982 $ this ->config ,
989983 $ this ->appConfig ,
990984 $ this ->cacheFactory ,
@@ -1032,7 +1026,7 @@ public function testRunInstanceVerification(): void {
10321026 $ this ->assertSame ($ expected , $ app );
10331027 return [];
10341028 });
1035- $ this ->appLocator
1029+ $ this ->appManager
10361030 ->expects ($ this ->exactly (2 ))
10371031 ->method ('getAppPath ' )
10381032 ->willReturnMap ([
0 commit comments