function HookOrderTest::testBefore

@covers ::before

File

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

Class

HookOrderTest
@coversDefaultClass \Drupal\Core\Hook\HookOrder

Namespace

Drupal\Tests\Core\Hook

Code

public function testBefore() : void {
    // "a" was last, move it before "b".
    HookOrder::before($this->container, 'test', 'a::a', 'b::b');
    $this->assertGreaterThan($this->getPriority('b'), $this->getPriority('a'));
    // The relation between these should not change. The actual priority
    // might.
    $this->assertGreaterThan($this->getPriority('b'), $this->getPriority('c'));
    $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.