aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/IntegrityCheck
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/IntegrityCheck')
-rw-r--r--tests/lib/IntegrityCheck/CheckerTest.php9
-rw-r--r--tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php8
2 files changed, 12 insertions, 5 deletions
diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php
index c5a4f255397..8414a531464 100644
--- a/tests/lib/IntegrityCheck/CheckerTest.php
+++ b/tests/lib/IntegrityCheck/CheckerTest.php
@@ -713,7 +713,9 @@ class CheckerTest extends TestCase {
*/
public function testVerifyCoreSignatureWithModifiedMimetypelistSignatureData(): void {
$shippedMimetypeAliases = (array)json_decode(file_get_contents(\OC::$SERVERROOT . '/resources/config/mimetypealiases.dist.json'));
+ $shippedMimetypeNames = (array)json_decode(file_get_contents(\OC::$SERVERROOT . '/resources/config/mimetypenames.dist.json'));
$allAliases = array_merge($shippedMimetypeAliases, ['my-custom/mimetype' => 'custom']);
+ $allMimetypeNames = array_merge($shippedMimetypeNames, ['my-custom/mimetype' => 'Custom Document']);
$this->mimeTypeDetector
->method('getOnlyDefaultAliases')
@@ -723,9 +725,14 @@ class CheckerTest extends TestCase {
->method('getAllAliases')
->willReturn($allAliases);
+ $this->mimeTypeDetector
+ ->method('getAllNamings')
+ ->willReturn($allMimetypeNames);
+
$oldMimetypeList = new GenerateMimetypeFileBuilder();
$all = $this->mimeTypeDetector->getAllAliases();
- $newFile = $oldMimetypeList->generateFile($all);
+ $namings = $this->mimeTypeDetector->getAllNamings();
+ $newFile = $oldMimetypeList->generateFile($all, $namings);
// When updating the mimetype list the test assets need to be updated as well
// 1. Update core/js/mimetypelist.js with the new generated js by running the test with the next line uncommented:
diff --git a/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php b/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php
index 14cc8851178..1d0b3e4f24d 100644
--- a/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php
+++ b/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php
@@ -17,11 +17,11 @@ class ExcludeFileByNameFilterIteratorTest extends TestCase {
parent::setUp();
$this->filter = $this->getMockBuilder(ExcludeFileByNameFilterIterator::class)
->disableOriginalConstructor()
- ->setMethods(['current'])
+ ->onlyMethods(['current'])
->getMock();
}
- public function fileNameProvider(): array {
+ public static function fileNameProvider(): array {
return [
['a file', true],
['Thumbs.db', false],
@@ -42,7 +42,7 @@ class ExcludeFileByNameFilterIteratorTest extends TestCase {
public function testAcceptForFiles($fileName, $expectedResult): void {
$iteratorMock = $this->getMockBuilder(\RecursiveDirectoryIterator::class)
->disableOriginalConstructor()
- ->setMethods(['getFilename', 'isDir'])
+ ->onlyMethods(['getFilename', 'isDir'])
->getMock();
$iteratorMock->method('getFilename')
@@ -64,7 +64,7 @@ class ExcludeFileByNameFilterIteratorTest extends TestCase {
public function testAcceptForDirs($fileName, $expectedResult): void {
$iteratorMock = $this->getMockBuilder(\RecursiveDirectoryIterator::class)
->disableOriginalConstructor()
- ->setMethods(['getFilename', 'isDir'])
+ ->onlyMethods(['getFilename', 'isDir'])
->getMock();
$iteratorMock->method('getFilename')