3 namespace Drupal\KernelTests\Core\Render\Element;
5 use Drupal\Core\Form\FormInterface;
6 use Drupal\Core\Form\FormStateInterface;
7 use Drupal\KernelTests\KernelTestBase;
10 * @coversDefaultClass \Drupal\Core\Render\Element\Actions
13 class ActionsTest extends KernelTestBase implements FormInterface {
18 public static $modules = ['system'];
23 public function getFormId() {
29 public function buildForm(array $form, FormStateInterface $form_state) {
30 $form['actions'] = ['#type' => 'actions'];
31 $form['actions']['key'] = [
34 '#dropbutton' => 'submit',
44 $form['actions']['submit'] = [
54 public function validateForm(array &$form, FormStateInterface $form_state) {
60 public function submitForm(array &$form, FormStateInterface $form_state) {
63 public function testDropbuttonWithBubbleableMetadata() {
64 $result = \Drupal::formBuilder()->getForm($this);
65 \Drupal::service('renderer')->renderRoot($result);
66 $this->assertEquals(['system/base', 'core/drupal.dropbutton'], $result['#attached']['library']);
67 $this->assertEquals(['foo'], $result['#cache']['tags']);