PathUnitTestBase.php 774 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Drupal\KernelTests\Core\Path;
  3. use Drupal\Core\Database\Database;
  4. use Drupal\KernelTests\KernelTestBase;
  5. use Drupal\system\Tests\Path\UrlAliasFixtures;
  6. /**
  7. * Base class for Path/URL alias integration tests.
  8. */
  9. abstract class PathUnitTestBase extends KernelTestBase {
  10. /**
  11. * @var \Drupal\system\Tests\Path\UrlAliasFixtures
  12. */
  13. protected $fixtures;
  14. protected function setUp() {
  15. parent::setUp();
  16. $this->fixtures = new UrlAliasFixtures();
  17. // The alias whitelist expects that the menu path roots are set by a
  18. // menu router rebuild.
  19. \Drupal::state()->set('router.path_roots', ['user', 'admin']);
  20. }
  21. protected function tearDown() {
  22. $this->fixtures->dropTables(Database::getConnection());
  23. parent::tearDown();
  24. }
  25. }