You are here

public function ArgumentsResolverTest::testGetWildcardArgument in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php \Drupal\Tests\Component\Utility\ArgumentsResolverTest::testGetWildcardArgument()
  2. 9 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 87
Contains \Drupal\Tests\Component\Utility\ArgumentsResolverTest.

Class

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

Namespace

Drupal\Tests\Component\Utility

Code

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