You are here

public function FlaggingStorageTest::testCacheReset in Flag 8.4

Test that cache reset is working.

File

tests/src/Kernel/FlaggingStorageTest.php, line 57

Class

FlaggingStorageTest
Tests for flagging storage.

Namespace

Drupal\Tests\flag\Kernel

Code

public function testCacheReset() {

  // Flag the node on behalf of the user.
  $this->flagService
    ->flag($this->flag, $this->node, $this->account);
  $this
    ->assertTrue($this->flag
    ->isFlagged($this->node, $this->account));

  // Unflag and verify that the internal caches have been reset.
  $this->flagService
    ->unflag($this->flag, $this->node, $this->account);
  $this
    ->assertFalse($this->flag
    ->isFlagged($this->node, $this->account));
}