Skip to content
Snippets Groups Projects

Draft: Additional tests

3 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
302 CFormAlterHooks::class . '::formAlter',
303 ], $this->alter('form')['#calls'] ?? NULL);
304
305 $this->assertSameCallList([
306 BFormAlterHooks::class . '::formAlter',
307 BFormAlterHooks::class . '::myFormAlter',
308 AFormAlterHooks::class . '::formAlter',
309 AFormAlterHooks::class . '::formAlterAfterB',
310 AFormAlterHooks::class . '::formAlterAfterBExtra',
311 AFormAlterHooks::class . '::myFormAlter',
312 AFormAlterHooks::class . '::myFormAlterAfterB',
313 AFormAlterHooks::class . '::myFormAlterAfterBExtra',
314 ], $this->alter(['form', 'form_myform'])['#calls'] ?? NULL);
315 }
316
317 public function testHookOrder(): void {
  • 1 <?php
    2
    3 declare(strict_types = 1);
    4
    5 namespace Drupal\hk_d_test\Hook;
    6
    7 use Drupal\Core\Hook\Attribute\Hook;
    8 use Drupal\Core\Hook\Attribute\RemoveHook;
    9 use Drupal\Core\Hook\Attribute\ReOrderHook;
    10 use Drupal\Core\Hook\Order;
    11 use Drupal\hk_b_test\Hook\BHooks;
    12 use Drupal\hk_c_test\Hook\CHooks;
    13
    14 #[ReOrderHook('testhook', CHooks::class, 'testHookReOrderFirst', Order::First)]
    15 #[RemoveHook('testhook', BHooks::class, 'testHookRemoved')]
  • nicxvan
    nicxvan @nicxvan started a thread on the diff
  • 21 }
    22
    23 /**
    24 * This implementation is reordered from elsewhere.
    25 *
    26 * @see \Drupal\hk_d_test\Hook\DHooks
    27 */
    28 #[Hook('testhook')]
    29 public function testHookReOrderFirst(): string {
    30 return __METHOD__;
    31 }
    32
    33 /**
    34 * This implementation is removed from elsewhere.
    35 *
    36 * @see \Drupal\hk_d_test\Hook\DHooks
  • Andreas Hennings added 3 commits

    added 3 commits

    • 9e4b7507 - Reorder check that implementation exists
    • 4e411e62 - Merge branch 'nicxvan'
    • 51cc807f - Add tests to cover the new order attributes.

    Compare with previous version

  • Please register or sign in to reply
    Loading