2 declare(strict_types = 1);
24 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
39 protected function setUp()
41 $this->registry = $this->prophesize(Registry::class);
42 GeneralUtility::setSingletonInstance(Registry::class, $this->registry->reveal());
50 GeneralUtility::purgeInstances();
59 $this->registry->get(
'installUpdate', Compatibility7ExtractionUpdate::class,
false)->willReturn(
false);
61 $this->assertTrue($subject->updateNecessary());
69 $objectManager = $this->prophesize(ObjectManager::class);
70 GeneralUtility::setSingletonInstance(ObjectManager::class, $objectManager->reveal());
72 $listUtility = $this->prophesize(ListUtility::class);
73 $installUtility = $this->prophesize(InstallUtility::class);
74 $objectManager->get(InstallUtility::class)->willReturn($installUtility->reveal());
75 $objectManager->get(ListUtility::class)->willReturn($listUtility->reveal());
76 $extensionList = [
'compatibility7' => [
'foo' =>
'bar']];
77 $listUtility->getAvailableExtensions()->willReturn($extensionList);
78 $listUtility->getAvailableAndInstalledExtensions($extensionList)->willReturn($extensionList);
81 $this->assertTrue($subject->executeUpdate());
83 $installUtility->install(
'compatibility7')->shouldHaveBeenCalled();