You are here

public function OAuthKeyFormTest::testForm in Lightning API 8.3

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

File

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

Class

OAuthKeyFormTest
@group lightning_api

Namespace

Drupal\Tests\lightning_api\Kernel

Code

public function testForm() {
  $dir = \Drupal::service('file_system')
    ->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');
}