Skip to content

Commit

Permalink
IBX-8534: Dropped deprecated context and getIndexData from Storage
Browse files Browse the repository at this point in the history
  • Loading branch information
ViniTou committed Oct 11, 2024
1 parent 1418e73 commit 63ec224
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
10 changes: 3 additions & 7 deletions src/lib/FieldType/RichText/RichTextStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(StorageGateway $gateway, LoggerInterface $logger = n
/**
* @see \Ibexa\Contracts\Core\FieldType\FieldStorage
*/
public function storeFieldData(VersionInfo $versionInfo, Field $field, array $context)
public function storeFieldData(VersionInfo $versionInfo, Field $field)
{
$document = new DOMDocument();
$document->loadXML($field->value->data);
Expand Down Expand Up @@ -133,7 +133,7 @@ public function storeFieldData(VersionInfo $versionInfo, Field $field, array $co
* @param \Ibexa\Contracts\Core\Persistence\Content\Field $field
* @param array $context
*/
public function getFieldData(VersionInfo $versionInfo, Field $field, array $context)
public function getFieldData(VersionInfo $versionInfo, Field $field)
{
$document = new DOMDocument();
$document->loadXML($field->value->data);
Expand Down Expand Up @@ -186,7 +186,7 @@ public function getFieldData(VersionInfo $versionInfo, Field $field, array $cont
$field->value->data = $document->saveXML();
}

public function deleteFieldData(VersionInfo $versionInfo, array $fieldIds, array $context)
public function deleteFieldData(VersionInfo $versionInfo, array $fieldIds)
{
foreach ($fieldIds as $fieldId) {
$this->gateway->unlinkUrl($fieldId, $versionInfo->versionNo);
Expand All @@ -202,8 +202,4 @@ public function hasFieldData()
{
return true;
}

public function getIndexData(VersionInfo $versionInfo, Field $field, array $context)
{
}
}
20 changes: 4 additions & 16 deletions tests/lib/FieldType/RichText/RichTextStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ public function testGetFieldData($xmlString, $updatedXmlString, $linkIds, $linkU
$storage = $this->getPartlyMockedStorage($gateway);
$storage->getFieldData(
$versionInfo,
$field,
$this->getContext()
$field
);

self::assertEquals(
Expand Down Expand Up @@ -238,8 +237,7 @@ public function testStoreFieldData(
$storage = $this->getPartlyMockedStorage($gateway);
$result = $storage->storeFieldData(
$versionInfo,
$field,
$this->getContext()
$field
);

self::assertEquals(
Expand Down Expand Up @@ -345,8 +343,7 @@ public function testStoreFieldDataThrowsNotFoundException(
$storage = $this->getPartlyMockedStorage($gateway);
$storage->storeFieldData(
$versionInfo,
$field,
$this->getContext()
$field
);
}

Expand All @@ -366,8 +363,7 @@ public function testDeleteFieldData(): void

$storage->deleteFieldData(
$versionInfo,
$fieldIds,
$this->getContext()
$fieldIds
);
}

Expand All @@ -389,14 +385,6 @@ protected function getPartlyMockedStorage(StorageGateway $gateway)
->getMock();
}

/**
* @return array
*/
protected function getContext()
{
return ['context'];
}

/**
* @var \Psr\Log\LoggerInterface|\PHPUnit\Framework\MockObject\MockObject
*/
Expand Down

0 comments on commit 63ec224

Please sign in to comment.