function HookOrderTest::testAfter

@covers ::after

File

core/tests/Drupal/Tests/Core/Hook/HookOrderTest.php, line 87

Class

HookOrderTest
@coversDefaultClass \Drupal\Core\Hook\HookOrder

Namespace

Drupal\Tests\Core\Hook

Code

public function testAfter() : void {
    // "c" was first, move it after "b".
    HookOrder::after($this->container, 'test', 'c::c', 'b::b');
    $this->assertGreaterThan($this->getPriority('c'), $this->getPriority('b'));
    // The relation between these should not change. The actual priority
    // might.
    $this->assertGreaterThan($this->getPriority('a'), $this->getPriority('b'));
    $this->assertGreaterThan($this->getPriority('a'), $this->getPriority('c'));
}

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