function ArgumentsResolverTest::testHandleUnresolvedArgument

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

Tests handleUnresolvedArgument() for missing arguments.

@dataProvider providerTestHandleUnresolvedArgument

File

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

Class

ArgumentsResolverTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Component%21Utility%21ArgumentsResolver.php/class/ArgumentsResolver/9" title="Resolves the arguments to pass to a callable." class="local">\Drupal\Component\Utility\ArgumentsResolver</a> @group Access

Namespace

Drupal\Tests\Component\Utility

Code

public function testHandleUnresolvedArgument($callable) {
    $resolver = new ArgumentsResolver([], [], []);
    $this->expectException(\RuntimeException::class);
    $this->expectExceptionMessage('requires a value for the "$foo" argument.');
    $resolver->getArguments($callable);
}

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