<?php

namespace Drupal\Tests\dc_core\Functional;

use Drupal\Tests\dc_core\Functional\DrupalUiBase;
use Symfony\Component\Process\Process;
use Drupal\Core\Config\FileStorage;

/**
 * Tests that the Rules UI pages are reachable.
 *
 * @group rules_ui
 */
class LotrTests extends DrupalUiBase {

  /**
   * Modules to enable.
   *
   * @var array
   */
  protected static $modules = [
    'node',
    'dc_core',
  ];

  /**
   * Theme to enable.
   *
   * @var string
   */
  protected $defaultTheme = 'dchadwick';

  protected $adminUser;

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();
  }

  public function testSite200() {
    $this->drupalGet('<front>');
    $this->assertSession()->statusCodeEquals(200);
  }

  public function testControllerData() {
    $this->drupalGet("api/character-list");
    $session = $this->assertSession();
    $session->statusCodeEquals(200);
    $session->responseHeaderEquals('Content-Type', 'application/json');
    $session->pageTextContains("Frodo Baggins");
  }

}
