From 86904fb77703e4f89a6e75d64c266570221e94a3 Mon Sep 17 00:00:00 2001 From: Dumazeau Date: Wed, 10 Jan 2024 12:59:33 +0100 Subject: [PATCH] Add new configuration configuration_template_path --- build/logs/clover.xml | 213 ++++++++++++++++++ phpunit.xml.dist | 1 + .../Port/ConfigurationInterfaceTest.php | 2 +- .../Stub/ConfigurationAdapterStub.php | 8 +- 4 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 build/logs/clover.xml diff --git a/build/logs/clover.xml b/build/logs/clover.xml new file mode 100644 index 0000000..0d9aa05 --- /dev/null +++ b/build/logs/clover.xml @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c08d8a3..90c3228 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -36,6 +36,7 @@ src/Infrastructure/Migrations src/Infrastructure/Resources src/Infrastructure/TestCase + src/Domain/Helper/SqlConfigurationHelperTrait.php src/Infrastructure/RichIdConfigurationBundle.php diff --git a/tests/Domain/Port/ConfigurationInterfaceTest.php b/tests/Domain/Port/ConfigurationInterfaceTest.php index d56c437..f03e2a5 100644 --- a/tests/Domain/Port/ConfigurationInterfaceTest.php +++ b/tests/Domain/Port/ConfigurationInterfaceTest.php @@ -35,7 +35,7 @@ public function testGetConfigurationTemplatePathDefaultValue(): void } - public function testGetConfigurationTemplatePathCsutomValue(): void + public function testGetConfigurationTemplatePathCustomValue(): void { $this->configurationAdapterStub->setConfigurationTemplatePath('/tests/Resources/configuration_template.php.txt'); $conf = $this->configuration->getConfigurationTemplatePath(); diff --git a/tests/Resources/Stub/ConfigurationAdapterStub.php b/tests/Resources/Stub/ConfigurationAdapterStub.php index 901beef..5f2c206 100644 --- a/tests/Resources/Stub/ConfigurationAdapterStub.php +++ b/tests/Resources/Stub/ConfigurationAdapterStub.php @@ -18,6 +18,7 @@ class ConfigurationAdapterStub extends ConfigurationAdapter implements OverrideS private ?string $configurationNamespace = null; private ?string $configurationPath = null; private ?string $configurationTemplatePath = null; + private bool $isConfigurationTemplatePathSet = false; public function getConfigurationNamespace(): string { @@ -39,7 +40,11 @@ public function getConfigurationPath(): string public function getConfigurationTemplatePath(): ?string { - return $this->configurationTemplatePath; + if ($this->isConfigurationTemplatePathSet) { + return $this->configurationTemplatePath; + } + + return $this->innerService->getConfigurationTemplatePath(); } public function setConfigurationNamespace(?string $configurationNamespace): self @@ -58,6 +63,7 @@ public function setConfigurationPath(?string $configurationPath): self public function setConfigurationTemplatePath(?string $configurationTemplatePath): self { + $this->isConfigurationTemplatePathSet = true; $this->configurationTemplatePath = $configurationTemplatePath; return $this;