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

Tests the Operations settings form.

@group advagg

Hierarchy

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

Expanded class hierarchy of OperationsFormTest

File

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() {
        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

Title Sort descending Modifiers Object type Summary
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.