2 declare(strict_types = 1);
18 use Prophecy\Argument;
19 use TYPO3\CMS\Core\Configuration\ConfigurationManager;
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
35 'aFeature' =>
'iAmEnabled',
49 $GLOBALS[
'TYPO3_CONF_VARS'][
'EXTENSIONS'][
'someExtension'] = [
50 'aFeature' =>
'iAmEnabled',
63 $GLOBALS[
'TYPO3_CONF_VARS'][
'EXTENSIONS'][
'someExtension'] = [
64 'aFeature' =>
'iAmEnabled',
69 $this->assertSame((
new ExtensionConfiguration())->
get(
'someExtension',
'aFlagCategory'), [
'someFlag' =>
'foo']);
77 $this->expectException(\RuntimeException::class);
78 $this->expectExceptionCode(1509715852);
87 $configurationManagerProphecy = $this->prophesize(ConfigurationManager::class);
88 GeneralUtility::addInstance(ConfigurationManager::class, $configurationManagerProphecy->reveal());
89 $configurationManagerProphecy->removeLocalConfigurationKeysByPath([
'EXTENSIONS/foo'])->shouldBeCalled();
98 $configurationManagerProphecy = $this->prophesize(ConfigurationManager::class);
99 GeneralUtility::addInstance(ConfigurationManager::class, $configurationManagerProphecy->reveal());
100 $configurationManagerProphecy->setLocalConfigurationValueByPath(Argument::cetera())->shouldBeCalled();
101 $configurationManagerProphecy->setLocalConfigurationValueByPath(
'EXTENSIONS/foo', [
'bar' =>
'baz'])->shouldBeCalled();
110 $configurationManagerProphecy = $this->prophesize(ConfigurationManager::class);
111 GeneralUtility::addInstance(ConfigurationManager::class, $configurationManagerProphecy->reveal());
112 $configurationManagerProphecy->setLocalConfigurationValueByPath(Argument::cetera())->shouldBeCalled();
113 $configurationManagerProphecy->setLocalConfigurationValueByPath(
'EXT/extConf', [
'foo' => serialize([
'bar' =>
'baz'])])->shouldBeCalled();
122 $configurationManagerProphecy = $this->prophesize(ConfigurationManager::class);
123 GeneralUtility::addInstance(ConfigurationManager::class, $configurationManagerProphecy->reveal());
126 'subLevelKey' =>
true,
129 $expectedLegacyExtConf = [
131 'subLevelKey' =>
true,
134 $configurationManagerProphecy->setLocalConfigurationValueByPath(Argument::cetera())->shouldBeCalled();
135 $configurationManagerProphecy->setLocalConfigurationValueByPath(
'EXT/extConf', [
'someExtension' => serialize($expectedLegacyExtConf)])->shouldBeCalled();
144 $configurationManagerProphecy = $this->prophesize(ConfigurationManager::class);
145 GeneralUtility::addInstance(ConfigurationManager::class, $configurationManagerProphecy->reveal());
153 $expectedLegacyExtConf = [
160 $configurationManagerProphecy->setLocalConfigurationValueByPath(Argument::cetera())->shouldBeCalled();
161 $configurationManagerProphecy->setLocalConfigurationValueByPath(
'EXT/extConf', [
'someExtension' => serialize($expectedLegacyExtConf)])->shouldBeCalled();