You are here

public function TxBufferTest::testGetByProperty in Purge 8.3

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

File

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

Class

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

Namespace

Drupal\Tests\purge\Kernel\Queue

Code

public function testGetByProperty() : void {
  $i = $this
    ->getInvalidations(1);
  $this->purgeQueueTxbuffer
    ->set($i, TxBufferInterface::CLAIMED);
  $this->purgeQueueTxbuffer
    ->setProperty($i, 'find', 'me');
  $this
    ->assertFalse($this->purgeQueueTxbuffer
    ->getByProperty('find', 'you'));
  $this
    ->assertFalse($this->purgeQueueTxbuffer
    ->getByProperty('find', 0));
  $match = $this->purgeQueueTxbuffer
    ->getByProperty('find', 'me');
  $this
    ->assertTrue($match instanceof InvalidationInterface);
  $this
    ->assertEquals($i
    ->getId(), $match
    ->getId());
}