Skip to content

Commit

Permalink
OXDEV-8215 Moved LanguageWrapper into infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
RahatHameed committed Jul 9, 2024
1 parent 1622769 commit e86e1d0
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 20 deletions.
13 changes: 0 additions & 13 deletions src/Shared/Core/services.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

declare(strict_types=1);

namespace OxidEsales\GraphQL\ConfigurationAccess\Shared\Core;
namespace OxidEsales\GraphQL\ConfigurationAccess\Shared\Infrastructure;

use OxidEsales\Eshop\Core\Language;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace OxidEsales\GraphQL\ConfigurationAccess\Shared\Core;
namespace OxidEsales\GraphQL\ConfigurationAccess\Shared\Infrastructure;

interface LanguageWrapperInterface
{
Expand Down
13 changes: 13 additions & 0 deletions src/Shared/Infrastructure/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
_defaults:
public: false
autowire: true
bind:
OxidEsales\Eshop\Core\Language: '@=service("OxidEsales\\GraphQL\\ConfigurationAccess\\Shared\\Infrastructure\\Registry").getLang()'

OxidEsales\GraphQL\ConfigurationAccess\Shared\Infrastructure\Registry:
class: OxidEsales\Eshop\Core\Registry
public: true

OxidEsales\GraphQL\ConfigurationAccess\Shared\Infrastructure\LanguageWrapperInterface:
class: OxidEsales\GraphQL\ConfigurationAccess\Shared\Infrastructure\LanguageWrapper
2 changes: 1 addition & 1 deletion src/Shared/Service/LanguageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace OxidEsales\GraphQL\ConfigurationAccess\Shared\Service;

use OxidEsales\GraphQL\ConfigurationAccess\Shared\Core\LanguageWrapperInterface;
use OxidEsales\GraphQL\ConfigurationAccess\Shared\Infrastructure\LanguageWrapperInterface;

class LanguageService implements LanguageServiceInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/services.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
imports:
- { resource: Core/services.yaml }
- { resource: Infrastructure/services.yaml }

services:
_defaults:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@

declare(strict_types=1);

namespace OxidEsales\GraphQL\ConfigurationAccess\Tests\Unit\Shared\Core;
namespace OxidEsales\GraphQL\ConfigurationAccess\Tests\Unit\Shared\Infrastructure;

use OxidEsales\GraphQL\ConfigurationAccess\Shared\Core\LanguageWrapper;
use OxidEsales\GraphQL\ConfigurationAccess\Shared\Infrastructure\LanguageWrapper;
use PHPUnit\Framework\TestCase;
use OxidEsales\Eshop\Core\Language;

/**
* @covers \OxidEsales\GraphQL\ConfigurationAccess\Shared\Infrastructure\LanguageWrapper
*/
class LanguageWrapperTest extends TestCase
{
public function testGetBaseLanguage(): void
Expand Down
5 changes: 4 additions & 1 deletion tests/Unit/Shared/Service/LanguageServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@

namespace OxidEsales\GraphQL\ConfigurationAccess\Tests\Unit\Shared\Service;

use OxidEsales\GraphQL\ConfigurationAccess\Shared\Core\LanguageWrapperInterface;
use OxidEsales\GraphQL\ConfigurationAccess\Shared\Infrastructure\LanguageWrapperInterface;
use OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\LanguageService;
use PHPUnit\Framework\TestCase;

/**
* @covers \OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\LanguageService
*/
class LanguageServiceTest extends TestCase
{
public function testFilterByLanguageAbbreviationCorrectLangValue()
Expand Down

0 comments on commit e86e1d0

Please sign in to comment.