function BackendChainImplementationUnitTest::testDelete
Tests that delete will propagate.
File
- 
              core/
tests/ Drupal/ Tests/ Core/ Cache/ BackendChainImplementationUnitTest.php, line 143  
Class
- BackendChainImplementationUnitTest
 - Unit test of backend chain implementation specifics.
 
Namespace
Drupal\Tests\Core\CacheCode
public function testDelete() {
  $this->chain
    ->set('test', 5);
  $cached = $this->firstBackend
    ->get('test');
  $this->assertNotFalse($cached, 'Test key has been added to the first backend');
  $cached = $this->secondBackend
    ->get('test');
  $this->assertNotFalse($cached, 'Test key has been added to the first backend');
  $cached = $this->thirdBackend
    ->get('test');
  $this->assertNotFalse($cached, 'Test key has been added to the first backend');
  $this->chain
    ->delete('test');
  $cached = $this->firstBackend
    ->get('test');
  $this->assertFalse($cached, 'Test key is removed from the first backend');
  $cached = $this->secondBackend
    ->get('test');
  $this->assertFalse($cached, 'Test key is removed from the second backend');
  $cached = $this->thirdBackend
    ->get('test');
  $this->assertFalse($cached, 'Test key is removed from the third backend');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.