function HookAlterOrderTest::assertAlterCallOrder

Asserts the call order from an alter call.

Also asserts additional $type argument values that are meant to produce the same result.

Parameters

list<string> $expected: Expected call list, as strings from __METHOD__ or __FUNCTION__.

string|list<string> $type: First argument to pass to ->alter().

2 calls to HookAlterOrderTest::assertAlterCallOrder()
HookAlterOrderTest::testAlterOrder in core/tests/Drupal/KernelTests/Core/Hook/HookAlterOrderTest.php
Test ordering alter calls.
HookAlterOrderTest::testProceduralModuleImplementsAlterOrder in core/tests/Drupal/KernelTests/Core/Hook/HookAlterOrderTest.php
Tests procedural implementations of module implements alter ordering.

File

core/tests/Drupal/KernelTests/Core/Hook/HookAlterOrderTest.php, line 209

Class

HookAlterOrderTest
@group Hook @group legacy

Namespace

Drupal\KernelTests\Core\Hook

Code

protected function assertAlterCallOrder(array $expected, string|array $type) : void {
    $this->assertSameCallList($expected, $this->alter($type));
}

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