Skip to content

Commit

Permalink
OXDEV-8215: Revert Interface usage; Fix NamespaceMapperTest;
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelOxid committed Jul 30, 2024
1 parent 3f2c331 commit ca18cbd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Module/DataType/ModuleFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
public function filterModuleByTitle(ModuleDataType $module): bool
{
$titleFilter = $this->titleFilter;
if ($titleFilter !== null && $module->getTitle() !== null) {
if ($titleFilter !== null) {
return $titleFilter->matches($module->getTitle());
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Module/Controller/ModuleListControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OxidEsales\GraphQL\ConfigurationAccess\Tests\Unit\Module\Controller;

use OxidEsales\GraphQL\ConfigurationAccess\Module\Controller\ModuleListController;
use OxidEsales\GraphQL\ConfigurationAccess\Module\DataType\ModuleFiltersInterface;
use OxidEsales\GraphQL\ConfigurationAccess\Module\DataType\ModuleFilters;
use OxidEsales\GraphQL\ConfigurationAccess\Module\Service\ModuleListServiceInterface;
use OxidEsales\GraphQL\ConfigurationAccess\Tests\Unit\UnitTestCase;
use OxidEsales\GraphQL\ConfigurationAccess\Module\DataType\ModuleDataType;
Expand All @@ -22,7 +22,7 @@ class ModuleListControllerTest extends UnitTestCase
{
public function testModulesListWithFilters(): void
{
$filtersStub = $this->createStub(ModuleFiltersInterface::class);
$filtersStub = $this->createStub(ModuleFilters::class);
$moduleStub1 = $this->createStub(ModuleDataType::class);
$moduleStub2 = $this->createStub(ModuleDataType::class);
$filteredModules = [$moduleStub1, $moduleStub2];
Expand Down
4 changes: 3 additions & 1 deletion tests/Unit/Shared/Service/NamespaceMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ public function testGetTypeNamespaceMapping(): void
$expectedMapping = [
$this->namespacePrefix . '\\Shared\\DataType' =>
$this->srcPath . '/Shared/Service/../../Shared/DataType/',
$this->namespacePrefix . '\\Theme\\DataType' =>
$this->srcPath . '/Theme/Service/../../Theme/DataType/',
$this->namespacePrefix . '\\Module\\DataType' =>
$this->srcPath . '/Shared/Service/../../Module/DataType/',
$this->srcPath . '/Module/Service/../../Module/DataType/',
];

$sut = $this->getSut();
Expand Down

0 comments on commit ca18cbd

Please sign in to comment.