You are here

public function DbLogFormInjectionTest::testLoggerSerialization in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/dblog/src/Tests/DbLogFormInjectionTest.php \Drupal\dblog\Tests\DbLogFormInjectionTest::testLoggerSerialization()

Tests db log injection serialization.

File

core/modules/dblog/src/Tests/DbLogFormInjectionTest.php, line 100
Contains \Drupal\dblog\Tests\DbLogFormInjectionTest.

Class

DbLogFormInjectionTest
Tests serializing a form with an injected dblog logger instance.

Namespace

Drupal\dblog\Tests

Code

public function testLoggerSerialization() {
  $form_state = new FormState();

  // Forms are only serialized during POST requests.
  $form_state
    ->setRequestMethod('POST');
  $form_state
    ->setCached();
  $form_builder = $this->container
    ->get('form_builder');
  $form_id = $form_builder
    ->getFormId($this, $form_state);
  $form = $form_builder
    ->retrieveForm($form_id, $form_state);
  $form_builder
    ->prepareForm($form_id, $form, $form_state);
  $form_builder
    ->processForm($form_id, $form, $form_state);
}