only in patch2: unchanged: --- a/core/modules/jsonld/lib/Drupal/jsonld/Tests/JsonldTestSetupHelper.php +++ b/core/modules/jsonld/lib/Drupal/jsonld/Tests/JsonldTestSetupHelper.php @@ -7,7 +7,6 @@ namespace Drupal\jsonld\Tests; -use Drupal\Core\Cache\DatabaseBackend; use Drupal\jsonld\JsonldEncoder; use Drupal\jsonld\JsonldEntityNormalizer; use Drupal\jsonld\JsonldEntityReferenceNormalizer; @@ -15,6 +14,7 @@ use Drupal\rdf\RdfMappingManager; use Drupal\rdf\EventSubscriber\MappingSubscriber; use Drupal\rdf\SiteSchema\SiteSchemaManager; +use Symfony\Component\DependencyInjection\Container; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\Serializer\Serializer; @@ -46,10 +46,13 @@ class JsonldTestSetupHelper { /** * Constructor. + * + * @param \Symfony\Component\DependencyInjection\Container $container + * The container. */ - public function __construct() { + public function __construct(Container $container) { // Construct site schema manager. - $this->siteSchemaManager = new SiteSchemaManager(new DatabaseBackend('cache')); + $this->siteSchemaManager = new SiteSchemaManager($container->get('cache.cache')); // Construct RDF mapping manager. $dispatcher = new EventDispatcher(); $dispatcher->addSubscriber(new MappingSubscriber()); only in patch2: unchanged: --- a/core/modules/jsonld/lib/Drupal/jsonld/Tests/NormalizeDenormalizeTest.php +++ b/core/modules/jsonld/lib/Drupal/jsonld/Tests/NormalizeDenormalizeTest.php @@ -51,7 +51,7 @@ public static function getInfo() { function setUp() { parent::setUp(); - $setup_helper = new JsonldTestSetupHelper(); + $setup_helper = new JsonldTestSetupHelper($this->container); $this->normalizers = $setup_helper->getNormalizers(); // Add German as a language. only in patch2: unchanged: --- a/core/modules/jsonld/lib/Drupal/jsonld/Tests/RdfSchemaSerializationTest.php +++ b/core/modules/jsonld/lib/Drupal/jsonld/Tests/RdfSchemaSerializationTest.php @@ -38,7 +38,7 @@ function testSchemaSerialization() { $schema = new SiteSchema(SiteSchema::CONTENT_DEPLOYMENT); $bundle_schema = $schema->bundle($entity_type, $bundle); // Set up the serializer. - $setup_helper = new JsonldTestSetupHelper(); + $setup_helper = new JsonldTestSetupHelper($this->container); $normalizer = new JsonldRdfSchemaNormalizer($setup_helper->getSiteSchemaManager(), $setup_helper->getRdfMappingManager()); $serializer = new Serializer(array($normalizer), array(new JsonldEncoder())); only in patch2: unchanged: --- a/core/modules/jsonld/lib/Drupal/jsonld/Tests/SupportsSerializationTest.php +++ b/core/modules/jsonld/lib/Drupal/jsonld/Tests/SupportsSerializationTest.php @@ -46,7 +46,7 @@ public static function getInfo() { function setUp() { parent::setUp(); - $setup_helper = new JsonldTestSetupHelper(); + $setup_helper = new JsonldTestSetupHelper($this->container); $this->normalizers = $setup_helper->getNormalizers(); } only in patch2: unchanged: --- a/core/modules/rdf/lib/Drupal/rdf/Tests/RdfMappingEventTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/RdfMappingEventTest.php @@ -6,7 +6,6 @@ namespace Drupal\rdf\Tests; -use Drupal\Core\Cache\DatabaseBackend; use Drupal\rdf\RdfMappingManager; use Drupal\rdf\EventSubscriber\MappingSubscriber; use Drupal\rdf_test_mapping\EventSubscriber\TestMappingSubscriber; @@ -45,7 +44,7 @@ public function testMapInputType() { $dispatcher = new EventDispatcher(); $dispatcher->addSubscriber(new MappingSubscriber()); $dispatcher->addSubscriber(new TestMappingSubscriber()); - $site_schema_manager = new SiteSchemaManager(new DatabaseBackend('cache')); + $site_schema_manager = new SiteSchemaManager($this->container->get('cache.cache')); $mapping_manager = new RdfMappingManager($dispatcher, $site_schema_manager); // Test that a site schema URI is mapped to itself. This is the default only in patch2: unchanged: --- a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php @@ -36,7 +36,7 @@ function setUp() { 'secret' => $GLOBALS['drupal_hash_salt'], ); // Use a non-persistent cache to avoid queries to non-existing tables. - $conf['cache_classes'] = array('cache' => 'Drupal\Core\Cache\MemoryBackend'); + $this->settingsSet('cache', array('default' => 'cache.backend.memory')); } /** only in patch2: unchanged: --- a/core/modules/system/lib/Drupal/system/Tests/Plugin/CacheDecoratorTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/CacheDecoratorTest.php @@ -7,6 +7,7 @@ namespace Drupal\system\Tests\Plugin; +use Drupal\Core\Flood\MemoryBackend; use Drupal\system\Tests\Plugin\Discovery\DiscoveryTestBase; use Drupal\Component\Plugin\Discovery\StaticDiscovery; use Drupal\Core\Plugin\Discovery\CacheDecorator; @@ -45,7 +46,8 @@ public function setUp() { // Use a non-db cache backend, so that we can use DiscoveryTestBase (which // extends UnitTestBase). - $conf['cache_classes'][$this->cacheBin] = 'Drupal\Core\Cache\MemoryBackend'; + // @todo switch to injecting the MemoryBackend http://drupal.org/node/1903346 + drupal_container()->set("cache.$this->cacheBin", new MemoryBackend()); // Create discovery objects to test. $this->emptyDiscovery = new StaticDiscovery();