You are here

public function SpecTest::testKwargsException in Little helpers 7.2

Test exception when keyword argument is not defined.

File

tests/Services/SpecTest.php, line 33

Class

SpecTest
Test the instantiating spec class.

Namespace

Drupal\little_helpers\Services

Code

public function testKwargsException() {
  $spec = Spec::fromInfo([
    'class' => \SplFixedArray::class,
    'constructor' => 'fromArray',
    'arguments' => [
      '%initial',
    ],
  ]);
  $this
    ->expectException(MissingArgumentException::class);
  $spec
    ->instantiate();
}