public function BackendChainImplementationUnitTest::testGetHasPropagated

Ensure get values propagation to previous backends.

File

drupal/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php, line 175
Definition of Drupal\Tests\Core\Cache\BackendChainImplementationUnitTest.

Class

BackendChainImplementationUnitTest
Tests implementation-specific functionality of the BackendChain backend.

Namespace

Drupal\Tests\Core\Cache

Code

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