Same name and namespace in other branches
  1. 5.0.x tests/src/Kernel/Form/OperationsFormTest.php \Drupal\Tests\advagg\Kernel\Form\OperationsFormTest 1 commentaire
  2. 8.x-4.x tests/src/Kernel/Form/OperationsFormTest.php \Drupal\Tests\advagg\Kernel\Form\OperationsFormTest 1 commentaire

Tests the Operations settings form.

@group advagg

Hierarchy

  • class \Drupal\Tests\advagg\Kernel\Form\OperationsFormTest extends \Drupal\KernelTests\KernelTestBase

Expanded class hierarchy of OperationsFormTest

Fichier

tests/src/Kernel/Form/OperationsFormTest.php, line 14

Namespace

Drupal\Tests\advagg\Kernel\Form
View source
class OperationsFormTest extends KernelTestBase {
    
    /**
     * The Operations form object under test.
     *
     * @var \Drupal\advagg\Form\OperationsForm
     */
    protected $operationsForm;
    
    /**
     * Modules to enable.
     *
     * @var array
     */
    protected static $modules = [
        'system',
        'advagg',
    ];
    
    /**
     * {@inheritdoc}
     *
     * @covers ::__construct
     */
    protected function setUp() : void {
        parent::setUp();
        $this->installConfig(static::$modules);
        $this->operationsForm = OperationsForm::create($this->container);
    }
    
    /**
     * Tests for \Drupal\advagg\Form\OperationsForm.
     */
    public function testOperationsForm() {
        $this->assertInstanceOf(FormInterface::class, $this->operationsForm);
        $id = $this->operationsForm
            ->getFormId();
        $this->assertEquals('advagg_operations', $id);
        $method = new \ReflectionMethod(OperationsForm::class, 'getEditableConfigNames');
        $method->setAccessible(TRUE);
        $name = $method->invoke($this->operationsForm);
        $this->assertEquals([
            'advagg.settings',
        ], $name);
    }

}

Members

Titre Trier par ordre décroissant Modifiers Object type Résumé
OperationsFormTest::$modules protected static property Modules to enable.
OperationsFormTest::$operationsForm protected property The Operations form object under test.
OperationsFormTest::setUp protected function @covers ::__construct
OperationsFormTest::testOperationsForm public function Tests for \Drupal\advagg\Form\OperationsForm.