diff --git a/core/lib/Drupal/Core/Cache/ChainedFastBackend.php b/core/lib/Drupal/Core/Cache/ChainedFastBackend.php index 5c0750d2098..62839c2b0e1 100644 --- a/core/lib/Drupal/Core/Cache/ChainedFastBackend.php +++ b/core/lib/Drupal/Core/Cache/ChainedFastBackend.php @@ -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; diff --git a/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php b/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php index 4d1485faef8..93dbd9ffb67 100644 --- a/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php +++ b/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php @@ -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. */