Skip to content

Commit

Permalink
Merge pull request #10 from customgento/DEV-362-add-github-actions
Browse files Browse the repository at this point in the history
Add github actions, DEV-362
  • Loading branch information
sprankhub authored Jun 5, 2024
2 parents 546c83e + c075dad commit ef2f0e1
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/coding-standard.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions .github/workflows/mess-detector.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions Helper/StoreUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
24 changes: 17 additions & 7 deletions Test/Integration/CheckDefaultStoreCodeHiddenInUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/**
Expand All @@ -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());
}
}
}

0 comments on commit ef2f0e1

Please sign in to comment.