Skip to content

Commit

Permalink
Replace NodeStorageInterface with RevisionableStorageInterface (#4112)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-m committed Feb 13, 2024
1 parent a0ff636 commit 116eee3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions modules/datastore/tests/src/Unit/Service/ResourcePurgerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@
use Drupal\Core\Config\ImmutableConfig;
use Drupal\Core\DependencyInjection\Container;
use Drupal\Core\Entity\Query\QueryInterface;
use Drupal\Core\Entity\RevisionableStorageInterface;
use Drupal\Core\Queue\QueueFactory;
use Drupal\Core\Queue\QueueInterface;

use Drupal\datastore\DatastoreService;
use Drupal\datastore\Service\ResourcePurger;
use Drupal\metastore\ReferenceLookupInterface;
use Drupal\metastore\Storage\Data;
use Drupal\metastore\Storage\DataFactory;
use Drupal\node\Entity\Node;
use Drupal\node\NodeStorageInterface;

use MockChain\Chain;
use MockChain\Options;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -63,8 +61,8 @@ public function testRevisionDisappearing() {

$chain = $this->getCommonChain()
->add(Data::class, 'getEntityIdFromUuid', 1)
->add(Data::class, 'getEntityStorage', NodeStorageInterface::class)
->add(NodeStorageInterface::class, 'getLatestRevisionId', 1);
->add(Data::class, 'getEntityStorage', RevisionableStorageInterface::class)
->add(RevisionableStorageInterface::class, 'getLatestRevisionId', 1);

$resourcePurger = ResourcePurger::create($chain->getMock());
$voidResult = $resourcePurger->schedule([1], FALSE);
Expand All @@ -78,11 +76,11 @@ public function testScheduleAllUuids() {

$chain = $this->getCommonChain()
->add(Data::class, 'getEntityIdFromUuid', 1)
->add(Data::class, 'getEntityStorage', NodeStorageInterface::class)
->add(NodeStorageInterface::class, 'getQuery', QueryInterface::class)
->add(Data::class, 'getEntityStorage', RevisionableStorageInterface::class)
->add(RevisionableStorageInterface::class, 'getQuery', QueryInterface::class)
->add(QueryInterface::class, 'condition', QueryInterface::class)
->add(QueryInterface::class, 'execute', [1])
->add(NodeStorageInterface::class, 'load', Node::class)
->add(RevisionableStorageInterface::class, 'load', Node::class)
->add(Node::class, 'uuid', 'foo')
->add(ImmutableConfig::class, 'get', 0);

Expand Down

0 comments on commit 116eee3

Please sign in to comment.