diff --git a/typo3/sysext/core/Tests/Unit/Imaging/IconFactoryTest.php b/typo3/sysext/core/Tests/Unit/Imaging/IconFactoryTest.php index 8c77839e0c1c..26c1ac319ad9 100644 --- a/typo3/sysext/core/Tests/Unit/Imaging/IconFactoryTest.php +++ b/typo3/sysext/core/Tests/Unit/Imaging/IconFactoryTest.php @@ -1,4 +1,5 @@ iconRegistryMock = $this->prophesize(\TYPO3\CMS\Core\Imaging\IconRegistry::class); + $this->iconRegistryMock = $this->prophesize(IconRegistry::class); $this->subject = new IconFactory($this->iconRegistryMock->reveal()); $this->iconRegistryMock->isRegistered('tcarecords--default')->willReturn(false); @@ -453,6 +453,7 @@ public function getIconForResourceWithMountRootReturnsMountFolderIcon() */ public function getIconForRecordWithNullTableReturnsMissingIcon() { + $GLOBALS['TCA']['']['ctrl'] = []; $this->assertContains( '', $this->subject->getIconForRecord('', [])->render() @@ -492,6 +493,7 @@ public function getIconForRecordWithMockRecordReturnsNormalIcon() 'ctrl' => [ 'typeicon_column' => 'CType', 'typeicon_classes' => [ + 'default' => '', 'text' => 'mimetypes-x-content-text', ], ], @@ -513,6 +515,7 @@ public function getIconForRecordWithMockRecordOfTypePluginReturnsPluginIcon() 'ctrl' => [ 'typeicon_column' => 'CType', 'typeicon_classes' => [ + 'default' => '', 'list' => 'mimetypes-x-content-plugin', ], ], @@ -539,6 +542,7 @@ public function getIconForRecordWithMockRecordWithHiddenFlagReturnsNormalIconAnd ], 'typeicon_column' => 'CType', 'typeicon_classes' => [ + 'default' => '', 'text' => 'mimetypes-x-content-text', ], ], @@ -560,9 +564,9 @@ public function getIconForRecordWithMockRecordWithHiddenFlagReturnsNormalIconAnd */ protected function getTestSubjectFileObject($extension, $mimeType = '') { - $mockedStorage = $this->createMock(\TYPO3\CMS\Core\Resource\ResourceStorage::class); - $mockedFile = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\File::class) - ->setConstructorArgs([[], $mockedStorage]) + $mockedStorage = $this->createMock(ResourceStorage::class); + $mockedFile = $this->getMockBuilder(File::class) + ->setConstructorArgs([['identifier' => '', 'name' => ''], $mockedStorage]) ->getMock(); $mockedFile->expects($this->atMost(1))->method('getExtension')->will($this->returnValue($extension)); $mockedFile->expects($this->atLeastOnce())->method('getMimeType')->will($this->returnValue($mimeType)); @@ -577,12 +581,12 @@ protected function getTestSubjectFileObject($extension, $mimeType = '') */ protected function getTestSubjectFolderObject($identifier) { - $mockedStorage = $this->createMock(\TYPO3\CMS\Core\Resource\ResourceStorage::class); + $mockedStorage = $this->createMock(ResourceStorage::class); $mockedStorage->expects($this->any())->method('getRootLevelFolder')->will($this->returnValue( - new \TYPO3\CMS\Core\Resource\Folder($mockedStorage, '/', '/') + new Folder($mockedStorage, '/', '/') )); $mockedStorage->expects($this->any())->method('checkFolderActionPermission')->will($this->returnValue(true)); $mockedStorage->expects($this->any())->method('isBrowsable')->will($this->returnValue(true)); - return new \TYPO3\CMS\Core\Resource\Folder($mockedStorage, $identifier, $identifier); + return new Folder($mockedStorage, $identifier, $identifier); } }