DictionaryNotFoundExceptionSpec   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_can_be_build_with_just_a_dictionary_name() 0 5 1
A it_is_initializable() 0 5 1
A it_can_be_build_with_a_dictionary_name_and_a_list_of_known_dictionaries() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace spec\Knp\DictionaryBundle\Exception;
6
7
use Knp\DictionaryBundle\Exception\DictionaryNotFoundException;
8
use PhpSpec\ObjectBehavior;
9
10
final class DictionaryNotFoundExceptionSpec extends ObjectBehavior
11
{
12
    function it_is_initializable()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
13
    {
14
        $this->beConstructedWith('dico_name');
15
16
        $this->shouldHaveType(DictionaryNotFoundException::class);
17
    }
18
19
    function it_can_be_build_with_just_a_dictionary_name()
20
    {
21
        $this->beConstructedWith('dico_name');
22
23
        $this->getMessage()->shouldReturn('The dictionary "dico_name" has not been found in the registry.');
0 ignored issues
show
Bug introduced by
The method getMessage() does not exist on spec\Knp\DictionaryBundl...ryNotFoundExceptionSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        $this->/** @scrutinizer ignore-call */ 
24
               getMessage()->shouldReturn('The dictionary "dico_name" has not been found in the registry.');
Loading history...
24
    }
25
26
    function it_can_be_build_with_a_dictionary_name_and_a_list_of_known_dictionaries()
27
    {
28
        $this->beConstructedWith('dico_name', ['dico1', 'dico2']);
29
30
        $this->getMessage()->shouldReturn('The dictionary "dico_name" has not been found in the registry. Known dictionaries are: "dico1", "dico2".');
31
    }
32
}
33