Skip to content

Commit ef2f0e1

Browse files
authored
Merge pull request #10 from customgento/DEV-362-add-github-actions
Add github actions, DEV-362
2 parents 546c83e + c075dad commit ef2f0e1

File tree

6 files changed

+49
-7
lines changed

6 files changed

+49
-7
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: ExtDN M2 Coding Standard
2+
on: [push, pull_request]
3+
4+
jobs:
5+
phpcs:
6+
uses: customgento/m2-github-actions/.github/workflows/coding-standard.yml@main

.github/workflows/integration.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: ExtDN M2 Integration
2+
on: [push, pull_request]
3+
4+
jobs:
5+
integration:
6+
uses: customgento/m2-github-actions/.github/workflows/integration.yml@main
7+
with:
8+
module_name: CustomGento_DefaultStoreCodeRemover
9+
composer_name: customgento/module-default-store-code-remover-m2
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: ExtDN M2 Mess Detector
2+
on: [push, pull_request]
3+
4+
jobs:
5+
phpmd:
6+
uses: customgento/m2-github-actions/.github/workflows/mess-detector.yml@main

.github/workflows/phpstan.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: ExtDN M2 PHPStan
2+
on: [push, pull_request]
3+
4+
jobs:
5+
phpstan:
6+
uses: customgento/m2-github-actions/.github/workflows/phpstan.yml@main
7+
with:
8+
composer_name: customgento/module-default-store-code-remover-m2

Helper/StoreUrl.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
use Magento\Store\Api\Data\StoreInterface;
88
use Magento\Store\Model\Store;
9+
/** @phpstan-ignore-next-line */
910
use MageWorx\SeoBase\Helper\StoreUrl as MageworxStoreUrl;
1011

12+
// phpcs:disable PSR1.Classes.ClassDeclaration.MultipleClasses
13+
1114
if (class_exists(MageworxStoreUrl::class)) {
1215
class StoreUrl extends MageworxStoreUrl
1316
{

Test/Integration/CheckDefaultStoreCodeHiddenInUrlTest.php

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testStoreCodeIsShownInNonDefaultStoreUrl(): void
3838
{
3939
$store = $this->storeRepository->get('test');
4040
$this->config->setValue(Store::XML_PATH_STORE_IN_URL, true, ScopeInterface::SCOPE_STORE, $store->getCode());
41-
$this->assertContains('test', $store->getBaseUrl());
41+
$this->assertStringContainsString('test', $store->getBaseUrl());
4242
}
4343

4444
/**
@@ -47,21 +47,31 @@ public function testStoreCodeIsShownInNonDefaultStoreUrl(): void
4747
public function testStoreCodeIsNotShownInNonDefaultStoreUrl(): void
4848
{
4949
$store = $this->storeRepository->get('test');
50-
$this->config->setValue(Store::XML_PATH_STORE_IN_URL, false, ScopeInterface::SCOPE_STORE, $store->getCode());
51-
$this->assertNotContains('test', $store->getBaseUrl());
50+
$this->config->setValue(
51+
Store::XML_PATH_STORE_IN_URL,
52+
false,
53+
ScopeInterface::SCOPE_STORE,
54+
$store->getCode()
55+
);
56+
$this->assertStringNotContainsString('test', $store->getBaseUrl());
5257
}
5358

5459
public function testStoreCodeIsNotShownInDefaultStoreUrl(): void
5560
{
5661
$store = $this->storeRepository->get('default');
57-
$this->config->setValue(Store::XML_PATH_STORE_IN_URL, false, ScopeInterface::SCOPE_STORE, $store->getCode());
58-
$this->assertNotContains('default', $store->getBaseUrl());
62+
$this->config->setValue(
63+
Store::XML_PATH_STORE_IN_URL,
64+
false,
65+
ScopeInterface::SCOPE_STORE,
66+
$store->getCode()
67+
);
68+
$this->assertStringNotContainsString('default', $store->getBaseUrl());
5969
}
6070

6171
public function testStoreCodeIsShownInDefaultStoreUrl(): void
6272
{
6373
$store = $this->storeRepository->get('default');
6474
$this->config->setValue(Store::XML_PATH_STORE_IN_URL, true, ScopeInterface::SCOPE_STORE, $store->getCode());
65-
$this->assertNotContains('default', $store->getBaseUrl());
75+
$this->assertStringNotContainsString('default', $store->getBaseUrl());
6676
}
67-
}
77+
}

0 commit comments

Comments
 (0)