Skip to content

Commit

Permalink
OXDEV-8234 Small code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaIvanovski committed May 17, 2024
1 parent f634a33 commit e46b8ad
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/schedule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '16 1 */7 * *'

jobs:
jeo_blocking_php82_mysql80:
geo_blocking_php82_mysql80:
if: always()
uses: oxid-eSales/github-actions/.github/workflows/universal_workflow_light.yaml@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
push: {}

jobs:
jeo_blocking_php82_mysql80:
geo_blocking_php82_mysql80:
uses: oxid-eSales/github-actions/.github/workflows/universal_workflow_light.yaml@v4
with:
testplan: '~/defaults/7.1.x.yaml,~/defaults/php8.2_mysql8.0_only.yaml,~/geo-blocking.yaml'
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Added
- PHP 8.2
- Upgraded to work with shop compilation 7.1.0
- Upgraded to work with OXID eShop 7.0.x

### Changed
- New module logo
Expand Down
3 changes: 2 additions & 1 deletion src/Component/UserComponent.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
*/

namespace OxidEsales\GeoBlocking\Component;

use OxidEsales\GeoBlocking\Model\Address ;
use OxidEsales\GeoBlocking\Model\Address;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\GeoBlocking\Service\CountryToShopService;

Expand Down
2 changes: 1 addition & 1 deletion tests/Codeception/Acceptance.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ modules:
- \OxidEsales\Codeception\Module\Translation\TranslationsModule:
shop_path: '%SHOP_SOURCE_PATH%'
paths:
- Application/views/apex
- Application/views/%THEME_ID%
- Application/views/admin_twig
- ../vendor/oxid-esales/geo-blocking-module/views/admin_twig
- ../vendor/oxid-esales/geo-blocking-module/translations
Expand Down
12 changes: 8 additions & 4 deletions tests/Codeception/Support/AcceptanceTester.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
Expand All @@ -7,6 +8,8 @@
namespace OxidEsales\GeoBlocking\Tests\Codeception\Support;

use OxidEsales\Codeception\Page\Home;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Setup\Bridge\ModuleActivationBridgeInterface;
use OxidEsales\Facts\Facts;

/**
Expand Down Expand Up @@ -39,10 +42,11 @@ public function openShop()
return $homePage;
}

public function setModuleActive(bool $active = true): void
public function setModuleActive(): void
{
$command = $active ? 'activate' : 'deactivate';

exec((new Facts())->getShopRootPath() . '/vendor/bin/oe-console oe:module:' . $command . ' oegeoblocking');
ContainerFactory::getInstance()
->getContainer()
->get(ModuleActivationBridgeInterface::class)
->activate('oegeoblocking', 1);
}
}
12 changes: 7 additions & 5 deletions tests/Integration/Component/UserComponentTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
Expand All @@ -7,7 +8,7 @@
namespace OxidEsales\GeoBlocking\Tests\Integration\Component;

use OxidEsales\Eshop\Application\Component\UserComponent;
use OxidEsales\GeoBlocking\Model\Address ;
use OxidEsales\GeoBlocking\Model\Address;
use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Field;
use OxidEsales\Eshop\Core\Registry;
Expand Down Expand Up @@ -55,7 +56,7 @@ public function testChangeUserWithoutRedirectWhenNotAllowedToChangeAddressData()
->getMock();
$addressMock->method('oeGeoBlockingIsUserChangingAddress')->willReturn(true);
Registry::set(Address::class, $addressMock);

$this->assertFalse($userComponent->changeUserWithoutRedirect());
$errors = Registry::getSession()->getVariable('Errors');
$this->assertSame(1, count($errors));
Expand Down Expand Up @@ -106,9 +107,10 @@ private function createActiveUser()
{
$user = new User();
$user->setId('user_id');
$user->assign(['oxpassword' => 'test']);
$user->assign(['oxusername' => 'test']);
$user->save();
$user->assign([
'oxusername' => 'test',
'oxpassword' => 'test'
]);
Registry::getSession()->setVariable('usr', 'user_id');
}
}

0 comments on commit e46b8ad

Please sign in to comment.