diff --git a/core/modules/system/tests/modules/form_test/src/Controller/FormTestController.php b/core/modules/system/tests/modules/form_test/src/Controller/FormTestController.php index 600b1d9..0a211f1 100644 --- a/core/modules/system/tests/modules/form_test/src/Controller/FormTestController.php +++ b/core/modules/system/tests/modules/form_test/src/Controller/FormTestController.php @@ -7,12 +7,41 @@ namespace Drupal\form_test\Controller; use Drupal\Core\Controller\ControllerBase; +use Drupal\Core\DependencyInjection\ContainerInjectionInterface; +use Drupal\Core\Form\FormBuilderInterface; use Drupal\Core\Language\LanguageInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Controller routines for form_test routes. */ -class FormTestController extends ControllerBase { +class FormTestController extends ControllerBase implements ContainerInjectionInterface { + + /** + * The form builder. + * + * @var \Drupal\Core\Form\FormBuilderInterface + */ + protected $formBuilder; + + /** + * Constructs a new FormTestController. + * + * @param \Drupal\Core\Form\FormBuilderInterface $form_builder + * The form builder. + */ + public function __construct(FormBuilderInterface $form_builder) { + $this->formBuilder = $form_builder; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('form_builder') + ); + } /** * Returns two instances of the node form.