function HookOrderEqualPriorityTest::testLast

@covers ::last

File

core/tests/Drupal/Tests/Core/Hook/HookOrderEqualPriorityTest.php, line 40

Class

HookOrderEqualPriorityTest
@coversDefaultClass \Drupal\Core\Hook\HookOrder

Namespace

Drupal\Tests\Core\Hook

Code

public function testLast() : void {
    // "c" was first, make it the last.
    HookOrder::last($this->container, 'test', 'c::c');
    $this->assertGreaterThan($this->getPriority('c'), $this->getPriority('a'));
    $this->assertGreaterThan($this->getPriority('c'), $this->getPriority('b'));
    // Nothing else can be asserted: by setting the same priority, the setup
    // had undefined order and so the services not included in the helper call
    // can be in any order.
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.