<?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 ContentTypeTests extends DrupalUiBase {

  /**
   * Modules to enable.
   *
   * @var array
   */
  protected static $modules = [
    'node',
    'file',
    'image',
    'link',
    'field',
    'field_group',
    'field_ui',
    'media',
    'pathauto',
    'media_library',
    'text',
    'taxonomy',
    'menu_ui',
    'layout_builder',
    'datetime',
    'color_field',
    /* 'dc_tests', */
  ];

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

  protected $adminUser;

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();
    $config_path =  DRUPAL_ROOT . '/modules/custom/dc_tests/config/install';
    $config_source = new FileStorage($config_path);
    \Drupal::service('module_installer')->install(['dc_tests']);
    \Drupal::service('config.installer')->installOptionalConfig($config_source);
  }

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

  /**
   * Tests that the reaction rule listing page works.
   */
  /* public function testFighter() { */
  /*   $perms = [ */
  /*     'access administration pages', */
  /*     'administer modules', */
  /*     'administer content types', */
  /*     'administer site configuration', */
  /*     'bypass node access', */
  /*     'access content overview', */
  /*   ]; */
  /*   // Create and log in an administrative user. */
  /*   $this->adminUser = $this->drupalCreateUser($perms); */
  /*   $this->drupalLogin($this->adminUser); */
  /*   $this->drupalGet('admin/config'); */
  /*   /1* $this->assertSession()->statusCodeEquals(200); *1/ */
  /*   $this->drupalGet('admin/structure/types'); */
  /*   $this->drupalGet('admin/modules'); */

  /* } */

}
