amp-8.x-3.5/tests/src/Functional/BasicTestCaseBase.php

tests/src/Functional/BasicTestCaseBase.php
<?php

namespace Drupal\Tests\amp\Functional;

use Drupal\Tests\BrowserTestBase;

/**
 * Test basic functionality of AMP Modules.
 *
 * @group amp
 */
abstract class BasicTestCaseBase extends BrowserTestBase {

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'classy';

  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'amp',
    'node',
    'metatag',
    'schema_metatag',
    'token',
    'views',
  ];

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    // Make sure to complete the normal setup steps first.
    parent::setUp();

    // Set the front page to "node".
    \Drupal::configFactory()
      ->getEditable('system.site')
      ->set('page.front', '/node')
      ->save(TRUE);
  }

  /**
   * Make sure the site still works. For now just check the front page.
   */
  public function testTheSiteStillWorks() {
    // Load the front page.
    $this->drupalGet('<front>');

    // Confirm that the site didn't throw a server error or something else.
    $this->assertSession()->statusCodeEquals(200);

    // Confirm that the front page contains the standard text.
    $this->assertSession()->pageTextContains('Welcome to Drupal');
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc