diff --git a/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php b/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php index 7889cc0..5626d3a 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php @@ -98,7 +98,7 @@ function testAdminAlias() { $this->assertText($node1->label(), 'Changed alias works.'); $this->assertResponse(200); - \Drupal::service('path.alias_manager')->cacheClear(); + $this->container->get('path.alias_manager')->cacheClear(); // Confirm that previous alias no longer works. $this->drupalGet($previous); $this->assertNoText($node1->label(), 'Previous alias no longer works.'); diff --git a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php index 7f2664d..291b633 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php @@ -84,7 +84,7 @@ function testAliasTranslation() { $this->drupalPost(NULL, $edit, t('Save')); // Clear the path lookup cache. - \Drupal::service('path.alias_manager')->cacheClear(); + $this->container->get('path.alias_manager')->cacheClear(); // Ensure the node was created. $french_node = $this->drupalGetNodeByTitle($edit["title"]); @@ -149,18 +149,18 @@ function testAliasTranslation() { // The alias manager has an internal path lookup cache. Check to see that // it has the appropriate contents at this point. - \Drupal::service('path.alias_manager')->cacheClear(); - $french_node_path = \Drupal::service('path.alias_manager')->getSystemPath($french_alias, $french_node->langcode); + $this->container->get('path.alias_manager')->cacheClear(); + $french_node_path = $this->container->get('path.alias_manager')->getSystemPath($french_alias, $french_node->langcode); $this->assertEqual($french_node_path, 'node/' . $french_node->nid, 'Normal path works.'); // Second call should return the same path. - $french_node_path = \Drupal::service('path.alias_manager')->getSystemPath($french_alias, $french_node->langcode); + $french_node_path = $this->container->get('path.alias_manager')->getSystemPath($french_alias, $french_node->langcode); $this->assertEqual($french_node_path, 'node/' . $french_node->nid, 'Normal path is the same.'); // Confirm that the alias works. - $french_node_alias = \Drupal::service('path.alias_manager')->getPathAlias('node/' . $french_node->nid, $french_node->langcode); + $french_node_alias = $this->container->get('path.alias_manager')->getPathAlias('node/' . $french_node->nid, $french_node->langcode); $this->assertEqual($french_node_alias, $french_alias, 'Alias works.'); // Second call should return the same alias. - $french_node_alias = \Drupal::service('path.alias_manager')->getPathAlias('node/' . $french_node->nid, $french_node->langcode); + $french_node_alias = $this->container->get('path.alias_manager')->getPathAlias('node/' . $french_node->nid, $french_node->langcode); $this->assertEqual($french_node_alias, $french_alias, 'Alias is the same.'); } }