You are here

public function OAuthKeyFormTest::testForm in Lightning API 8

Same name and namespace in other branches
  1. 8.4 tests/src/Kernel/OAuthKeyFormTest.php \Drupal\Tests\lightning_api\Kernel\OAuthKeyFormTest::testForm()
  2. 8.2 tests/src/Kernel/OAuthKeyFormTest.php \Drupal\Tests\lightning_api\Kernel\OAuthKeyFormTest::testForm()
  3. 8.3 tests/src/Kernel/OAuthKeyFormTest.php \Drupal\Tests\lightning_api\Kernel\OAuthKeyFormTest::testForm()

File

tests/src/Kernel/OAuthKeyFormTest.php, line 24

Class

OAuthKeyFormTest
@group lightning @group lightning_api

Namespace

Drupal\Tests\lightning_api\Kernel

Code

public function testForm() {
  $dir = drupal_realpath('temporary://');
  $form_state = (new FormState())
    ->setValues([
    'dir' => $dir,
    'private_key' => 'private.key',
    'public_key' => 'public.key',
  ]);
  $this->container
    ->get('form_builder')
    ->submitForm(OAuthKeyForm::class, $form_state);
  $this
    ->assertKey($dir . '/private.key');
  $this
    ->assertKey($dir . '/public.key');
}