You are here

public function TxBufferTest::testCurrent in Purge 8.3

Tests \Drupal\purge\Plugin\Purge\Queue\TxBuffer::current.

File

tests/src/Kernel/Queue/TxBufferTest.php, line 56

Class

TxBufferTest
Tests \Drupal\purge\Tests\Queue\TxBufferTest.

Namespace

Drupal\Tests\purge\Kernel\Queue

Code

public function testCurrent() : void {
  $objects = $this
    ->getInvalidations(5);
  $this
    ->assertFalse($this->purgeQueueTxbuffer
    ->current());
  $this->purgeQueueTxbuffer
    ->set($objects, TxBufferInterface::CLAIMED);
  $c = $this->purgeQueueTxbuffer
    ->current();
  $this
    ->assertTrue($c instanceof InvalidationInterface);
  $this
    ->assertEquals($objects[0]
    ->getId(), $c
    ->getId());
}