getRequirements(); if (!empty($requirements)) { foreach ($requirements as $message) { $this->pass($message); } return TRUE; } return FALSE; } /** * {@inheritdoc} */ protected function createCacheBackend($bin) { if (version_compare(phpversion('apcu'), '5.0.0', '>=')) { return new ApcuBackend($bin, $this->databasePrefix, \Drupal::service('cache_tags.invalidator.checksum')); } else { return new Apcu4Backend($bin, $this->databasePrefix, \Drupal::service('cache_tags.invalidator.checksum')); } } /** * {@inheritdoc} */ protected function tearDown() { foreach ($this->cachebackends as $bin => $cachebackend) { $this->cachebackends[$bin]->removeBin(); } parent::tearDown(); } /** * {@inheritdoc} */ public function testSetGet() { if ($this->requirementsFail()) { return; } parent::testSetGet(); // Make sure entries are permanent (i.e. no TTL). $backend = $this->getCacheBackend($this->getTestBin()); $key = $backend->getApcuKey('TEST8'); if (class_exists('\APCUIterator')) { $iterator = new \APCUIterator('/^' . $key . '/'); } else { $iterator = new \APCIterator('user', '/^' . $key . '/'); } foreach ($iterator as $item) { $this->assertEqual(0, $item['ttl']); $found = TRUE; } $this->assertTrue($found); } /** * {@inheritdoc} */ public function testDelete() { if ($this->requirementsFail()) { return; } parent::testDelete(); } /** * {@inheritdoc} */ public function testValueTypeIsKept() { if ($this->requirementsFail()) { return; } parent::testValueTypeIsKept(); } /** * {@inheritdoc} */ public function testGetMultiple() { if ($this->requirementsFail()) { return; } parent::testGetMultiple(); } /** * {@inheritdoc} */ public function testSetMultiple() { if ($this->requirementsFail()) { return; } parent::testSetMultiple(); } /** * {@inheritdoc} */ public function testDeleteMultiple() { if ($this->requirementsFail()) { return; } parent::testDeleteMultiple(); } /** * {@inheritdoc} */ public function testDeleteAll() { if ($this->requirementsFail()) { return; } parent::testDeleteAll(); } /** * {@inheritdoc} */ public function testInvalidate() { if ($this->requirementsFail()) { return; } parent::testInvalidate(); } /** * {@inheritdoc} */ public function testInvalidateTags() { if ($this->requirementsFail()) { return; } parent::testInvalidateTags(); } /** * {@inheritdoc} */ public function testInvalidateAll() { if ($this->requirementsFail()) { return; } parent::testInvalidateAll(); } /** * {@inheritdoc} */ public function testRemoveBin() { if ($this->requirementsFail()) { return; } parent::testRemoveBin(); } }