class PathTestBase

Same name and namespace in other branches
  1. 11.x core/modules/path/tests/src/Functional/PathTestBase.php \Drupal\Tests\path\Functional\PathTestBase
  2. 10 core/modules/path/tests/src/Functional/PathTestBase.php \Drupal\Tests\path\Functional\PathTestBase
  3. 8.9.x core/modules/path/src/Tests/PathTestBase.php \Drupal\path\Tests\PathTestBase
  4. 8.9.x core/modules/path/tests/src/Functional/PathTestBase.php \Drupal\Tests\path\Functional\PathTestBase

Provides a base class for testing the Path module.

Hierarchy

Expanded class hierarchy of PathTestBase

File

core/modules/path/tests/src/Functional/PathTestBase.php, line 11

Namespace

Drupal\Tests\path\Functional
View source
abstract class PathTestBase extends BrowserTestBase {
  use PathAliasTestTrait;
  
  /**
   * Modules to enable.
   *
   * @var array
   */
  protected static $modules = [
    'node',
    'path',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    // Create Basic page and Article node types.
    if ($this->profile != 'standard') {
      $this->drupalCreateContentType([
        'type' => 'page',
        'name' => 'Basic page',
      ]);
      $this->drupalCreateContentType([
        'type' => 'article',
        'name' => 'Article',
      ]);
    }
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.