You are here

public function BackendChainImplementationUnitTest::testGetHasPropagated in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php \Drupal\Tests\Core\Cache\BackendChainImplementationUnitTest::testGetHasPropagated()
  2. 10 core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php \Drupal\Tests\Core\Cache\BackendChainImplementationUnitTest::testGetHasPropagated()

Ensure get values propagation to previous backends.

File

core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php, line 163

Class

BackendChainImplementationUnitTest
Unit test of backend chain implementation specifics.

Namespace

Drupal\Tests\Core\Cache

Code

public function testGetHasPropagated() {
  $this->chain
    ->get('t23');
  $cached = $this->firstBackend
    ->get('t23');
  $this
    ->assertNotFalse($cached, 'Test 2 has been propagated to the first backend');
  $this->chain
    ->get('t3');
  $cached = $this->firstBackend
    ->get('t3');
  $this
    ->assertNotFalse($cached, 'Test 3 has been propagated to the first backend');
  $cached = $this->secondBackend
    ->get('t3');
  $this
    ->assertNotFalse($cached, 'Test 3 has been propagated to the second backend');
}