Revert "Issue #2662844 by penyaskito, dawehner, catch: cache.backend.chainedfast misbehaves in some situations"

This reverts commit 4eb87a26df.
8.3.x
Alex Pott 2016-09-29 13:44:40 +01:00
parent 4a53d2f4cd
commit 2766d1a729
2 changed files with 0 additions and 23 deletions

View File

@ -87,16 +87,8 @@ class ChainedFastBackend implements CacheBackendInterface, CacheTagsInvalidatorI
* The fast cache backend.
* @param string $bin
* The cache bin for which the object is created.
*
* @throws \Exception
* When the consistent cache backend and the fast cache backend are the same
* service.
*/
public function __construct(CacheBackendInterface $consistent_backend, CacheBackendInterface $fast_backend, $bin) {
if ($consistent_backend == $fast_backend) {
// @todo: should throw a proper exception. See https://www.drupal.org/node/2751847.
trigger_error('Consistent cache backend and fast cache backend cannot use the same service.', E_USER_ERROR);
}
$this->consistentBackend = $consistent_backend;
$this->fastBackend = $fast_backend;
$this->bin = 'cache_' . $bin;

View File

@ -33,21 +33,6 @@ class ChainedFastBackendTest extends UnitTestCase {
*/
protected $bin;
/**
* Tests that chained fast backend cannot be constructed with two instances of
* the same service.
*/
public function testConsistentAndFastBackendCannotBeTheSameService() {
// ToDo: It should throw a proper exception. See https://www.drupal.org/node/2751847.
$this->setExpectedException(\PHPUnit_Framework_Error::class, 'Consistent cache backend and fast cache backend cannot use the same service.');
$cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
$chained_fast_backend = new ChainedFastBackend(
$cache,
$cache,
'foo'
);
}
/**
* Tests a get() on the fast backend, with no hit on the consistent backend.
*/