Skip to content

Commit 3070c5a

Browse files
committed
Add workaround for 'Icon with identifier "default-not-found" is not registered'
1 parent 92d1afc commit 3070c5a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Tests/Functional/AbstractCase.php

+17
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
use Cundd\Rest\VirtualObject\Persistence\RawQueryBackendInterface;
2323
use Doctrine\DBAL\DBALException;
2424
use Psr\Log\LoggerInterface as PsrLoggerInterface;
25+
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
26+
use TYPO3\CMS\Core\Imaging\IconRegistry;
2527
use TYPO3\CMS\Core\Tests\FunctionalTestCase;
2628
use TYPO3\CMS\Core\Utility\GeneralUtility;
2729
use TYPO3\CMS\Extbase\Object\Container\Container;
@@ -173,6 +175,8 @@ public function injectPropertyIntoObject($propertyValue, $propertyKey, $object)
173175
*/
174176
private function buildConfiguredObjectManager()
175177
{
178+
$this->initializeIconRegistry();
179+
176180
/** @var Container $objectContainer */
177181
$objectContainer = GeneralUtility::makeInstance(Container::class);
178182

@@ -282,4 +286,17 @@ protected function registerLoggerImplementation()
282286
$container->registerImplementation(PsrLoggerInterface::class, StreamLogger::class);
283287
$container->registerImplementation(CunddLoggerInterface::class, StreamLogger::class);
284288
}
289+
290+
private function initializeIconRegistry()
291+
{
292+
$iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
293+
294+
if (!$iconRegistry->isRegistered('default-not-found')) {
295+
$iconRegistry->registerIcon(
296+
'default-not-found',
297+
SvgIconProvider::class,
298+
['source' => 'EXT:rest/ext_icon.svg']
299+
);
300+
}
301+
}
285302
}

0 commit comments

Comments
 (0)