setRebuild(); } /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->installSchema('dblog', ['watchdog']); $this->installSchema('system', ['key_value_expire', 'sequences']); $this->installEntitySchema('user'); $this->logger = \Drupal::logger('test_logger'); $test_user = User::create([ 'name' => 'foobar', 'mail' => 'foobar@example.com', ]); $test_user->save(); \Drupal::service('current_user')->setAccount($test_user); } /** * Tests db log injection serialization. */ 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); } }