ContextRegistrySpec::it_stores_class_by_id()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the ContextServiceExtension package.
7
 *
8
 * (c) Kamil Kokot <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace spec\FriendsOfBehat\ContextServiceExtension\Context;
15
16
use PhpSpec\ObjectBehavior;
17
18
final class ContextRegistrySpec extends ObjectBehavior
19
{
20
    function it_stores_class_by_id(): void
21
    {
22
        $this->add('context_id', 'context_class');
23
24
        $this->getClass('context_id')->shouldReturn('context_class');
25
    }
26
27
    function it_throws_an_exception_if_trying_to_get_class_by_unexisting_id(): void
28
    {
29
        $this->shouldThrow(\InvalidArgumentException::class)->during('getClass', ['context_id']);
30
    }
31
}
32