function HookOrderTest::testLast

@covers ::last

File

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

Class

HookOrderTest
@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'));
    // The other two shouldn't change.
    $this->assertNoChange('c');
}

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