function ArgumentsResolverTest::testGetWildcardArgument

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php \Drupal\Tests\Component\Utility\ArgumentsResolverTest::testGetWildcardArgument()
  2. 8.9.x core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php \Drupal\Tests\Component\Utility\ArgumentsResolverTest::testGetWildcardArgument()
  3. 11.x core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php \Drupal\Tests\Component\Utility\ArgumentsResolverTest::testGetWildcardArgument()

Tests getArgument() with a wildcard object for a parameter with a custom name.

File

core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php, line 93

Class

ArgumentsResolverTest
@coversDefaultClass \Drupal\Component\Utility\ArgumentsResolver @group Access

Namespace

Drupal\Tests\Component\Utility

Code

public function testGetWildcardArgument() : void {
    $callable = function (\stdClass $custom_name) {
    };
    $object = new \stdClass();
    $arguments = (new ArgumentsResolver([], [], [
        $object,
    ]))->getArguments($callable);
    $this->assertSame([
        $object,
    ], $arguments);
}

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