public function BackendChainImplementationUnitTest::testGetMultipleHasPropagated

Ensure get multiple values propagation to previous backends.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Cache/BackendChainImplementationUnitTest.php, line 188
Definition of Drupal\system\Tests\Cache\BackendChainImplementationUnitTest.

Class

BackendChainImplementationUnitTest
Tests implementation-specific functionality of the BackendChain backend.

Namespace

Drupal\system\Tests\Cache

Code

public function testGetMultipleHasPropagated() {
  $cids = array(
    't3',
    't23',
  );
  $this->chain
    ->getMultiple($cids);
  $cached = $this->firstBackend
    ->get('t3');
  $this
    ->assertNotIdentical(FALSE, $cached, 'Test 3 has been propagated to the first backend');
  $this
    ->assertIdentical(33, $cached->data, 'And value has been kept');
  $cached = $this->secondBackend
    ->get('t3');
  $this
    ->assertNotIdentical(FALSE, $cached, 'Test 3 has been propagated to the second backend');
  $this
    ->assertIdentical(33, $cached->data, 'And value has been kept');
  $cached = $this->firstBackend
    ->get('t23');
  $this
    ->assertNotIdentical(FALSE, $cached, 'Test 2 has been propagated to the first backend');
  $this
    ->assertIdentical(232, $cached->data, 'And value has been kept');
}