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

testMakeInternalClassWithOptionalMiddleArgumentSkipped()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 13
rs 10
c 1
b 0
f 0
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