function BackendChainImplementationUnitTest::testRemoveBin

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php \Drupal\Tests\Core\Cache\BackendChainImplementationUnitTest::testRemoveBin()
  2. 8.9.x core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php \Drupal\Tests\Core\Cache\BackendChainImplementationUnitTest::testRemoveBin()
  3. 11.x core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php \Drupal\Tests\Core\Cache\BackendChainImplementationUnitTest::testRemoveBin()

Tests that removing bin propagates to all backends.

File

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

Class

BackendChainImplementationUnitTest
Unit test of backend chain implementation specifics.

Namespace

Drupal\Tests\Core\Cache

Code

public function testRemoveBin() : void {
    $chain = new BackendChain();
    for ($i = 0; $i < 3; $i++) {
        $backend = $this->createMock('Drupal\\Core\\Cache\\CacheBackendInterface');
        $backend->expects($this->once())
            ->method('removeBin');
        $chain->appendBackend($backend);
    }
    $chain->removeBin();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.