You are here

public function ArgumentsResolverTest::testHandleNotUpcastedArgument in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php \Drupal\Tests\Component\Utility\ArgumentsResolverTest::testHandleNotUpcastedArgument()

Tests handleUnresolvedArgument() for a scalar argument.

@expectedException \RuntimeException @expectedExceptionMessage requires a value for the "$foo" argument.

File

core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php, line 159
Contains \Drupal\Tests\Component\Utility\ArgumentsResolverTest.

Class

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

Namespace

Drupal\Tests\Component\Utility

Code

public function testHandleNotUpcastedArgument() {
  $objects = [
    'foo' => 'bar',
  ];
  $scalars = [
    'foo' => 'baz',
  ];
  $resolver = new ArgumentsResolver($scalars, $objects, []);
  $callable = function (\stdClass $foo) {
  };
  $arguments = $resolver
    ->getArguments($callable);
  $this
    ->assertNull($arguments);
}