Skip to content

Commit da93504

Browse files
weakbitcweiske
authored andcommitted
Fix tests for TYPO3 v13
1 parent 022a220 commit da93504

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

Tests/Unit/Index/ExtractorTest.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public function testCanProcessImageFileType()
5353
$storage->getDriverType()->willReturn(AmazonS3Driver::DRIVER_TYPE)->shouldBeCalled();
5454
$file = $this->prophesize(File::class);
5555
$file->getStorage()->willReturn($storage->reveal());
56-
$file->getType()->willReturn(File::FILETYPE_IMAGE)->shouldBeCalled();
56+
$file->getType()->willReturn(File::FILETYPE_IMAGE);
57+
$file->isImage()->willReturn(true);
5758

5859
$this->assertEquals(true, $this->extractor->canProcess($file->reveal()));
5960
}
@@ -68,6 +69,7 @@ public function testCanNotProcessOtherDriverType()
6869
$file = $this->prophesize(File::class);
6970
$file->getStorage()->willReturn($storage->reveal());
7071
$file->getType()->willReturn(File::FILETYPE_IMAGE);
72+
$file->isImage()->willReturn(true);
7173

7274
$this->assertEquals(false, $this->extractor->canProcess($file->reveal()));
7375
}
@@ -81,7 +83,8 @@ public function testCanNotProcessUnknownFileType()
8183
$storage->getDriverType()->willReturn(AmazonS3Driver::DRIVER_TYPE);
8284
$file = $this->prophesize(File::class);
8385
$file->getStorage()->willReturn($storage->reveal());
84-
$file->getType()->willReturn(File::FILETYPE_UNKNOWN)->shouldBeCalled();
86+
$file->getType()->willReturn(File::FILETYPE_UNKNOWN);
87+
$file->isImage()->willReturn(false);
8588

8689
$this->assertEquals(false, $this->extractor->canProcess($file->reveal()));
8790
}
@@ -95,7 +98,8 @@ public function testCanNotProcessApplicationFileType()
9598
$storage->getDriverType()->willReturn(AmazonS3Driver::DRIVER_TYPE);
9699
$file = $this->prophesize(File::class);
97100
$file->getStorage()->willReturn($storage->reveal());
98-
$file->getType()->willReturn(File::FILETYPE_APPLICATION)->shouldBeCalled();
101+
$file->getType()->willReturn(File::FILETYPE_APPLICATION);
102+
$file->isImage()->willReturn(false);
99103

100104
$this->assertEquals(false, $this->extractor->canProcess($file->reveal()));
101105
}
@@ -109,7 +113,8 @@ public function testCanNotProcessVideoFileType()
109113
$storage->getDriverType()->willReturn(AmazonS3Driver::DRIVER_TYPE);
110114
$file = $this->prophesize(File::class);
111115
$file->getStorage()->willReturn($storage->reveal());
112-
$file->getType()->willReturn(File::FILETYPE_VIDEO)->shouldBeCalled();
116+
$file->getType()->willReturn(File::FILETYPE_VIDEO);
117+
$file->isImage()->willReturn(false);
113118

114119
$this->assertEquals(false, $this->extractor->canProcess($file->reveal()));
115120
}
@@ -123,7 +128,8 @@ public function testCanNotProcessAudioFileType()
123128
$storage->getDriverType()->willReturn(AmazonS3Driver::DRIVER_TYPE);
124129
$file = $this->prophesize(File::class);
125130
$file->getStorage()->willReturn($storage->reveal());
126-
$file->getType()->willReturn(File::FILETYPE_AUDIO)->shouldBeCalled();
131+
$file->getType()->willReturn(File::FILETYPE_AUDIO);
132+
$file->isImage()->willReturn(false);
127133

128134
$this->assertEquals(false, $this->extractor->canProcess($file->reveal()));
129135
}
@@ -137,7 +143,8 @@ public function testCanNotProcessTextFileType()
137143
$storage->getDriverType()->willReturn(AmazonS3Driver::DRIVER_TYPE);
138144
$file = $this->prophesize(File::class);
139145
$file->getStorage()->willReturn($storage->reveal());
140-
$file->getType()->willReturn(File::FILETYPE_TEXT)->shouldBeCalled();
146+
$file->getType()->willReturn(File::FILETYPE_TEXT);
147+
$file->isImage()->willReturn(false);
141148

142149
$this->assertEquals(false, $this->extractor->canProcess($file->reveal()));
143150
}

0 commit comments

Comments
 (0)