diff --git a/.github/workflows/coding-standard.yml b/.github/workflows/coding-standard.yml new file mode 100644 index 0000000..37ecccb --- /dev/null +++ b/.github/workflows/coding-standard.yml @@ -0,0 +1,6 @@ +name: ExtDN M2 Coding Standard +on: [push, pull_request] + +jobs: + phpcs: + uses: customgento/m2-github-actions/.github/workflows/coding-standard.yml@main diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..8c58bb0 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,9 @@ +name: ExtDN M2 Integration +on: [push, pull_request] + +jobs: + integration: + uses: customgento/m2-github-actions/.github/workflows/integration.yml@main + with: + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 diff --git a/.github/workflows/mess-detector.yml b/.github/workflows/mess-detector.yml new file mode 100644 index 0000000..cf9e5b5 --- /dev/null +++ b/.github/workflows/mess-detector.yml @@ -0,0 +1,6 @@ +name: ExtDN M2 Mess Detector +on: [push, pull_request] + +jobs: + phpmd: + uses: customgento/m2-github-actions/.github/workflows/mess-detector.yml@main diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..6b7cded --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,8 @@ +name: ExtDN M2 PHPStan +on: [push, pull_request] + +jobs: + phpstan: + uses: customgento/m2-github-actions/.github/workflows/phpstan.yml@main + with: + composer_name: customgento/module-default-store-code-remover-m2 diff --git a/Helper/StoreUrl.php b/Helper/StoreUrl.php index b66eae8..e093aec 100644 --- a/Helper/StoreUrl.php +++ b/Helper/StoreUrl.php @@ -6,8 +6,11 @@ use Magento\Store\Api\Data\StoreInterface; use Magento\Store\Model\Store; +/** @phpstan-ignore-next-line */ use MageWorx\SeoBase\Helper\StoreUrl as MageworxStoreUrl; +// phpcs:disable PSR1.Classes.ClassDeclaration.MultipleClasses + if (class_exists(MageworxStoreUrl::class)) { class StoreUrl extends MageworxStoreUrl { diff --git a/Test/Integration/CheckDefaultStoreCodeHiddenInUrlTest.php b/Test/Integration/CheckDefaultStoreCodeHiddenInUrlTest.php index a4af262..1b135fb 100644 --- a/Test/Integration/CheckDefaultStoreCodeHiddenInUrlTest.php +++ b/Test/Integration/CheckDefaultStoreCodeHiddenInUrlTest.php @@ -38,7 +38,7 @@ public function testStoreCodeIsShownInNonDefaultStoreUrl(): void { $store = $this->storeRepository->get('test'); $this->config->setValue(Store::XML_PATH_STORE_IN_URL, true, ScopeInterface::SCOPE_STORE, $store->getCode()); - $this->assertContains('test', $store->getBaseUrl()); + $this->assertStringContainsString('test', $store->getBaseUrl()); } /** @@ -47,21 +47,31 @@ public function testStoreCodeIsShownInNonDefaultStoreUrl(): void public function testStoreCodeIsNotShownInNonDefaultStoreUrl(): void { $store = $this->storeRepository->get('test'); - $this->config->setValue(Store::XML_PATH_STORE_IN_URL, false, ScopeInterface::SCOPE_STORE, $store->getCode()); - $this->assertNotContains('test', $store->getBaseUrl()); + $this->config->setValue( + Store::XML_PATH_STORE_IN_URL, + false, + ScopeInterface::SCOPE_STORE, + $store->getCode() + ); + $this->assertStringNotContainsString('test', $store->getBaseUrl()); } public function testStoreCodeIsNotShownInDefaultStoreUrl(): void { $store = $this->storeRepository->get('default'); - $this->config->setValue(Store::XML_PATH_STORE_IN_URL, false, ScopeInterface::SCOPE_STORE, $store->getCode()); - $this->assertNotContains('default', $store->getBaseUrl()); + $this->config->setValue( + Store::XML_PATH_STORE_IN_URL, + false, + ScopeInterface::SCOPE_STORE, + $store->getCode() + ); + $this->assertStringNotContainsString('default', $store->getBaseUrl()); } public function testStoreCodeIsShownInDefaultStoreUrl(): void { $store = $this->storeRepository->get('default'); $this->config->setValue(Store::XML_PATH_STORE_IN_URL, true, ScopeInterface::SCOPE_STORE, $store->getCode()); - $this->assertNotContains('default', $store->getBaseUrl()); + $this->assertStringNotContainsString('default', $store->getBaseUrl()); } -} +} \ No newline at end of file