Same name in other branches
  1. 5.0.x advagg_validator/tests/src/Kernel/Form/JsHintFormTest.php \Drupal\Tests\advagg_validator\Kernel\Form\JsHintFormTest
  2. 6.0.x advagg_validator/tests/src/Kernel/Form/JsHintFormTest.php \Drupal\Tests\advagg_validator\Kernel\Form\JsHintFormTest

Tests the validator JsHint settings form.

@group advagg

Hierarchy

  • class \Drupal\Tests\advagg_validator\Kernel\Form\JsHintFormTest extends \Drupal\KernelTests\KernelTestBase

Expanded class hierarchy of JsHintFormTest

Fichier

advagg_validator/tests/src/Kernel/Form/JsHintFormTest.php, line 14

Namespace

Drupal\Tests\advagg_validator\Kernel\Form
View source
class JsHintFormTest extends KernelTestBase {
    
    /**
     * The validator JsHint settings form object under test.
     *
     * @var \Drupal\advagg_validator\Form\JsHintForm
     */
    protected $jsHintForm;
    
    /**
     * Modules to enable.
     *
     * @var array
     */
    protected static $modules = [];
    
    /**
     * {@inheritdoc}
     *
     * @covers ::__construct
     */
    protected function setUp() {
        parent::setUp();
        $this->installConfig(static::$modules);
        $this->jsHintForm = JsHintForm::create($this->container);
    }
    
    /**
     * Tests for \Drupal\advagg_validator\Form\JsHintForm.
     */
    public function testSettingsForm() {
        $this->assertInstanceOf(FormInterface::class, $this->jsHintForm);
        $id = $this->jsHintForm
            ->getFormId();
        $this->assertEquals('advagg_validator_jshint', $id);
        $method = new \ReflectionMethod(JsHintForm::class, 'getEditableConfigNames');
        $method->setAccessible(TRUE);
        $name = $method->invoke($this->jsHintForm);
        $this->assertEquals([
            'advagg_validator.settings',
        ], $name);
    }

}

Members

Titre Trier par ordre décroissant Modifiers Object type Résumé
JsHintFormTest::$jsHintForm protected property The validator JsHint settings form object under test.
JsHintFormTest::$modules protected static property Modules to enable.
JsHintFormTest::setUp protected function @covers ::__construct
JsHintFormTest::testSettingsForm public function Tests for \Drupal\advagg_validator\Form\JsHintForm.