Skip to content

Commit

Permalink
fix: Coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
Nattfarinn committed Apr 16, 2024
1 parent 7f80598 commit 6e14b09
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
*/
namespace eZ\Publish\Core\Persistence\Legacy\Tests\Content;

use eZ\Publish\Core\Persistence\Legacy\Content\Gateway;
use eZ\Publish\Core\Persistence\Legacy\Content\StorageRegistry;
use Ibexa\Core\Persistence\Legacy\Content\Mapper\ResolveVirtualFieldSubscriber;
use function count;
use eZ\Publish\API\Repository\Values\Content\Relation as RelationValue;
use eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter;
use eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry as Registry;
use eZ\Publish\Core\Persistence\Legacy\Content\Gateway;
use eZ\Publish\Core\Persistence\Legacy\Content\Mapper;
use eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue;
use eZ\Publish\Core\Persistence\Legacy\Content\StorageRegistry;
use eZ\Publish\SPI\Persistence\Content;
use eZ\Publish\SPI\Persistence\Content\ContentInfo;
use eZ\Publish\SPI\Persistence\Content\CreateStruct;
Expand All @@ -25,6 +24,7 @@
use eZ\Publish\SPI\Persistence\Content\Relation as SPIRelation;
use eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct as RelationCreateStruct;
use eZ\Publish\SPI\Persistence\Content\VersionInfo;
use Ibexa\Core\Persistence\Legacy\Content\Mapper\ResolveVirtualFieldSubscriber;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

Expand Down Expand Up @@ -715,7 +715,7 @@ protected function getRelationCreateStructFixture()

protected function getEventDispatcher(): EventDispatcherInterface
{
$eventDispatcher = new EventDispatcher();
$eventDispatcher = new EventDispatcher();
$eventDispatcher->addSubscriber(
new ResolveVirtualFieldSubscriber(
$this->getValueConverterRegistryMock(),
Expand Down
19 changes: 19 additions & 0 deletions eZ/Publish/Core/Search/Legacy/Tests/Content/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@

use eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter;
use eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry;
use eZ\Publish\Core\Persistence\Legacy\Content\Gateway;
use eZ\Publish\Core\Persistence\Legacy\Content\StorageRegistry;
use eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\DoctrineDatabase as ContentTypeGateway;
use eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler as ContentTypeHandler;
use eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper as ContentTypeMapper;
use eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler as ContentTypeUpdateHandler;
use eZ\Publish\Core\Persistence\Legacy\Tests\Content\LanguageAwareTestCase;
use eZ\Publish\SPI\Persistence\Content\Type\Handler as SPIContentTypeHandler;
use Ibexa\Core\Persistence\Legacy\Content\Mapper\ResolveVirtualFieldSubscriber;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

/**
* Abstract test suite for legacy search.
Expand Down Expand Up @@ -113,4 +118,18 @@ protected function getConverterRegistry()

return $this->converterRegistry;
}

protected function getEventDispatcher(): EventDispatcherInterface
{
$eventDispatcher = new EventDispatcher();
$eventDispatcher->addSubscriber(
new ResolveVirtualFieldSubscriber(
$this->getConverterRegistry(),
new StorageRegistry([]),
$this->createMock(Gateway::class)
)
);

return $eventDispatcher;
}
}
19 changes: 0 additions & 19 deletions eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@
use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
use eZ\Publish\Core\Persistence;
use eZ\Publish\Core\Persistence\Legacy\Content\FieldHandler;
use eZ\Publish\Core\Persistence\Legacy\Content\Gateway;
use eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper as LocationMapper;
use eZ\Publish\Core\Persistence\Legacy\Content\Mapper as ContentMapper;
use eZ\Publish\Core\Persistence\Legacy\Content\StorageRegistry;
use eZ\Publish\Core\Search\Legacy\Content;
use eZ\Publish\Core\Search\Legacy\Content\Location\Gateway as LocationGateway;
use eZ\Publish\SPI\Persistence\Content\ContentInfo;
use eZ\Publish\SPI\Persistence\Content\Type;
use Ibexa\Core\Persistence\Legacy\Content\Mapper\ResolveVirtualFieldSubscriber;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

/**
* Content Search test case for ContentSearchHandler.
Expand Down Expand Up @@ -1451,18 +1446,4 @@ public function testGetNonExistingFieldDefinition(): void

$this->getContentTypeHandler()->getFieldDefinition(0, Type::STATUS_DEFINED);
}

private function getEventDispatcher(): EventDispatcherInterface
{
$eventDispatcher = new EventDispatcher();
$eventDispatcher->addSubscriber(
new ResolveVirtualFieldSubscriber(
$this->getConverterRegistry(),
new StorageRegistry([]),
$this->createMock(Gateway::class)
)
);

return $eventDispatcher;
}
}

0 comments on commit 6e14b09

Please sign in to comment.