Passed
Pull Request — master (#17)
by Aleksei
11:42
created

InjectorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 15
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testMakeInternalClassWithOptionalMiddleArgumentSkipped() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Injector\Tests\Php7;
6
7
use Yiisoft\Injector\Injector;
8
use Yiisoft\Injector\MissingInternalArgumentException;
9
use Yiisoft\Injector\Tests\Common\BaseInjectorTest;
10
11
class InjectorTest extends BaseInjectorTest
12
{
13
    public function testMakeInternalClassWithOptionalMiddleArgumentSkipped(): void
14
    {
15
        $container = $this->getContainer();
16
17
        $this->expectException(MissingInternalArgumentException::class);
18
        $this->expectExceptionMessageMatches('/PHP internal/');
19
20
        (new Injector($container))->make(\SplFileObject::class, [
21
            'file_name' => __FILE__,
22
            // second parameter skipped
23
            // third parameter skipped
24
            'context' => null,
25
            'other-parameter' => true,
26
        ]);
27
    }
28
}
29