/**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state, $condition_id = NULL, $contexts = [])
 {
     $this->condition = $this->prepareCondition($condition_id);
     $temporary = $form_state->getTemporary();
     $temporary['gathered_contexts'] = $contexts;
     $form_state->setTemporary($temporary);
     // Allow the condition to add to the form.
     $form['condition'] = $this->condition->buildConfigurationForm([], $form_state);
     $form['condition']['#tree'] = TRUE;
     $form['actions'] = ['#type' => 'actions'];
     $form['actions']['submit'] = ['#type' => 'submit', '#value' => $this->submitButtonText(), '#button_type' => 'primary'];
     return $form;
 }
 /**
  * {@inheritdoc}
  */
 public function setTemporary(array $temporary)
 {
     $this->mainFormState->setTemporary($temporary);
     return $this;
 }
 /**
  * @covers ::setTemporary
  */
 public function testSetTemporary()
 {
     $temporary = ['FOO' => 'BAR'];
     $this->decoratedFormState->setTemporary($temporary)->shouldBeCalled();
     $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setTemporary($temporary));
 }