diff --git a/src/Theme/Infrastructure/CoreThemeFactory.php b/src/Theme/Infrastructure/CoreThemeFactory.php index 1cd0f2d..6e7a45a 100644 --- a/src/Theme/Infrastructure/CoreThemeFactory.php +++ b/src/Theme/Infrastructure/CoreThemeFactory.php @@ -17,11 +17,6 @@ class CoreThemeFactory implements CoreThemeFactoryInterface * @inheritDoc */ public function create(): Theme - { - return $this->createTheme(); - } - - protected function createTheme(): Theme { return oxNew(Theme::class); } diff --git a/tests/Integration/Infrastructure/CoreThemeFactoryTest.php b/tests/Integration/Infrastructure/CoreThemeFactoryTest.php new file mode 100644 index 0000000..da91c28 --- /dev/null +++ b/tests/Integration/Infrastructure/CoreThemeFactoryTest.php @@ -0,0 +1,30 @@ +create(); + $this->assertEquals(new Theme(), $theme); + + $anotherTheme = $coreThemeFactory->create(); + $this->assertNotEquals($theme, $anotherTheme); + } +} diff --git a/tests/Unit/Theme/Infrastructure/CoreThemeFactoryTest.php b/tests/Unit/Theme/Infrastructure/CoreThemeFactoryTest.php deleted file mode 100644 index decac7c..0000000 --- a/tests/Unit/Theme/Infrastructure/CoreThemeFactoryTest.php +++ /dev/null @@ -1,46 +0,0 @@ -getSut(); - $this->assertInstanceOf(Theme::class, $sut->create()); - } - - public function testCreateProducesDifferentObjectsOnEveryCall(): void - { - $model1 = $this->getSut()->create(); - $model2 = $this->getSut()->create(); - - $this->assertNotSame($model1, $model2); - } - - private function getSut(): CoreThemeFactory - { - $coreThemeFactoryMock = $this->getMockBuilder(CoreThemeFactory::class) - ->onlyMethods(['createTheme']) - ->getMock(); - - $coreThemeFactoryMock->method('createTheme') - ->willReturn(new Theme()); - - return $coreThemeFactoryMock; - } -}