diff --git a/tests/Integration/Legacy/Modules/ModuleInheritanceTest.php b/tests/Integration/Legacy/Modules/ModuleInheritanceTest.php index 2b6cd380cb..905634ecba 100644 --- a/tests/Integration/Legacy/Modules/ModuleInheritanceTest.php +++ b/tests/Integration/Legacy/Modules/ModuleInheritanceTest.php @@ -35,13 +35,12 @@ use PHPUnit\Framework\Attributes\DataProvider; use Psr\Container\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; + use function Symfony\Component\String\u; /** * Test, that the inheritance of modules and the shop works as expected. * - * See also OxidEsales\EshopCommunity\Tests\Integration\Modules\BCModuleInheritanceTest - * * Below, there are listed all possible combinations which are possible. You have to read the tables as follows: * E.g. Test Case 1.1 is: A "plain module class" "extends via PHP" a "Plain shop class" * @@ -61,10 +60,10 @@ * +--------------------------------------------------------------+--------------------+-------------------------+ * | extends via PHP | plain module class | namespaced module class | * +--------------------------------------------------------------+--------------------+-------------------------+ - * | plain module class which extends an other class | 2.1 | 2.3 | - * | namespaced module class which extends an other class | 2.2 | 2.4 | + * | plain module class which extends another class | 2.1 | 2.3 | + * | namespaced module class which extends another class | 2.2 | 2.4 | * | plain module class which chain extends a shop class | 2.5 | 2.7 | - * | namespaced module class which does not extend an other class | 2.6 | 2.8 | + * | namespaced module class which does not extend another class | 2.6 | 2.8 | * +--------------------------------------------------------------+--------------------+-------------------------+ * * Together with "2. Simple extending module classes from other modules" we implemented some other test cases. @@ -102,9 +101,6 @@ final class ModuleInheritanceTest extends IntegrationTestCase { use FilesystemTrait; - /** - * @var ContainerBuilder - */ private ContainerInterface $container; public function setUp(): void @@ -170,7 +166,8 @@ public function testModuleInheritanceTestPhpInheritanceForbidden( /** * This test covers PHP inheritance between module classes. * - * The tested module class extends the other module class directly like ' extends ' + * The tested module class extends the other module class directly + * like ' extends ' * or ' extends ' * In this case the parent class of the module class must be the parent module class as instantiated with oxNew * @@ -252,7 +249,7 @@ public static function dataProviderTestModuleInheritanceTestPhpInheritance(): ar return [ 'case_1_6' => [ 'moduleToActivate' => ['Vendor1/ModuleInheritance16'], - 'moduleClassName' => \OxidEsales\EshopCommunity\Tests\Integration\Legacy\Modules\TestDataInheritance\modules\Vendor1\ModuleInheritance16\MyClass::class, + 'moduleClassName' => TestDataInheritance\modules\Vendor1\ModuleInheritance16\MyClass::class, 'shopClassNames' => [\OxidEsales\EshopCommunity\Application\Model\Article::class, 'oxArticle'], ], 'case_1_7' => [ @@ -316,7 +313,7 @@ public static function dataProviderTestMultiModuleInheritanceTestPhpInheritance( 'case_2_8' => [ // Test case 2.8 namespaced module_2 extends namespaced module_1 'modulesToActivate' => ['Vendor1/ModuleInheritance28a', 'Vendor2/ModuleInheritance28b'], - 'moduleClassName' => \OxidEsales\EshopCommunity\Tests\Integration\Legacy\Modules\TestDataInheritance\modules\Vendor2\ModuleInheritance28b\MyClass::class, + 'moduleClassName' => TestDataInheritance\modules\Vendor2\ModuleInheritance28b\MyClass::class, 'shopClassNames' => [ MyClass::class, ], diff --git a/tests/Integration/Legacy/Modules/OnlineModuleNotifierTest.php b/tests/Integration/Legacy/Modules/OnlineModuleNotifierTest.php index 0be3b61c30..366933e916 100644 --- a/tests/Integration/Legacy/Modules/OnlineModuleNotifierTest.php +++ b/tests/Integration/Legacy/Modules/OnlineModuleNotifierTest.php @@ -9,7 +9,6 @@ namespace OxidEsales\EshopCommunity\Tests\Integration\Legacy\Modules; -use OxidEsales\Eshop\Core\DatabaseProvider; use OxidEsales\Eshop\Core\OnlineModulesNotifierRequest; use OxidEsales\Eshop\Core\OnlineModuleVersionNotifier; use OxidEsales\Eshop\Core\OnlineModuleVersionNotifierCaller; @@ -22,9 +21,6 @@ use OxidEsales\EshopCommunity\Internal\Framework\Module\Setup\Bridge\ModuleActivationBridgeInterface; use OxidEsales\EshopCommunity\Tests\FilesystemTrait; use OxidEsales\EshopCommunity\Tests\Integration\IntegrationTestCase; -use oxOnlineModulesNotifierRequest; -use oxOnlineModuleVersionNotifierCaller; -use PHPUnit\Framework\MockObject\MockObject; use StdClass; use Throwable; @@ -40,7 +36,6 @@ public function setUp(): void $this->installedModules = []; $this->backupVarDirectory(); - $this->truncateDatabase(); } public function tearDown(): void @@ -62,7 +57,6 @@ public function testVersionNotify(): void $this->installModule('with_everything'); - /** @var oxOnlineModuleVersionNotifierCaller|MockObject $oCaller */ $oCaller = $this->getMockBuilder(OnlineModuleVersionNotifierCaller::class)->disableOriginalConstructor() ->getMock(); $oCaller->expects($this->once()) @@ -73,12 +67,7 @@ public function testVersionNotify(): void $oNotifier->versionNotify(); } - /** - * Returns formed request which should be returned during testing. - * - * @return oxOnlineModulesNotifierRequest - */ - private function getExpectedRequest() + private function getExpectedRequest(): OnlineModulesNotifierRequest { $request = oxNew(OnlineModulesNotifierRequest::class); @@ -146,11 +135,6 @@ private function uninstallModule(string $moduleId): void ); } - private function truncateDatabase(): void - { - DatabaseProvider::getDb()->execute('DELETE FROM `oxconfigdisplay`'); - } - public function get(string $serviceId) { return ContainerFactory::getInstance()->getContainer()->get($serviceId);