You are here

SettingsFormTest.php in Advanced CSS/JS Aggregation 8.4

File

advagg_old_ie_compatibility/tests/src/Kernel/Form/SettingsFormTest.php
View source
<?php

namespace Drupal\Tests\advagg_old_ie_compatibility\Kernel\Form;

use Drupal\Core\Form\FormInterface;
use Drupal\KernelTests\KernelTestBase;
use Drupal\advagg_old_ie_compatibility\Form\SettingsForm;

/**
 * Tests the Modifier Minification settings form.
 *
 * @group advagg
 */
class SettingsFormTest extends KernelTestBase {

  /**
   * The Modifier Minification settings form object under test.
   *
   * @var \Drupal\advagg_old_ie_compatibility\Form\SettingsForm
   */
  protected $settingsForm;

  /**
   * Modules to enable.
   *
   * @var array
   */
  protected static $modules = [
    'system',
    'advagg',
    'advagg_old_ie_compatibility',
  ];

  /**
   * {@inheritdoc}
   *
   * @covers ::__construct
   */
  protected function setUp() {
    parent::setUp();
    $this
      ->installConfig(static::$modules);
    $this->settingsForm = SettingsForm::create($this->container);
  }

  /**
   * Tests for \Drupal\advagg_old_ie_compatibility\Form\SettingsForm.
   */
  public function testSettingsForm() {
    $this
      ->assertInstanceOf(FormInterface::class, $this->settingsForm);
    $id = $this->settingsForm
      ->getFormId();
    $this
      ->assertEquals('advagg_old_ie_compatibility_settings', $id);
    $method = new \ReflectionMethod(SettingsForm::class, 'getEditableConfigNames');
    $method
      ->setAccessible(TRUE);
    $name = $method
      ->invoke($this->settingsForm);
    $this
      ->assertEquals([
      'advagg_old_ie_compatibility.settings',
    ], $name);
  }

}

Classes

Namesort descending Description
SettingsFormTest Tests the Modifier Minification settings form.