Passed
Pull Request — master (#5)
by
unknown
06:14
created

StringFormatterSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_implements_string_formatter_interface() 0 3 1
A it_formats_to_lowercase_without_spaces() 0 3 1
A it_is_initializable() 0 3 1
1
<?php
2
3
/*
4
 * This file has been created by developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * another great project.
7
 * You can find more information about us on https://bitbag.shop and write us
8
 * an email on [email protected].
9
 */
10
11
declare(strict_types=1);
12
13
namespace spec\BitBag\SyliusElasticsearchPlugin\Formatter;
14
15
use BitBag\SyliusElasticsearchPlugin\Formatter\StringFormatter;
16
use BitBag\SyliusElasticsearchPlugin\Formatter\StringFormatterInterface;
17
use PhpSpec\ObjectBehavior;
18
19
final class StringFormatterSpec extends ObjectBehavior
20
{
21
    function it_is_initializable(): void
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...
22
    {
23
        $this->shouldHaveType(StringFormatter::class);
24
    }
25
26
    function it_implements_string_formatter_interface(): void
27
    {
28
        $this->shouldHaveType(StringFormatterInterface::class);
29
    }
30
31
    function it_formats_to_lowercase_without_spaces(): void
32
    {
33
        $this->formatToLowercaseWithoutSpaces('StrIng in-De-x')->shouldBeEqualTo('string_in_de_x');
0 ignored issues
show
Bug introduced by
The method formatToLowercaseWithoutSpaces() does not exist on spec\BitBag\SyliusElasti...ter\StringFormatterSpec. 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

33
        $this->/** @scrutinizer ignore-call */ 
34
               formatToLowercaseWithoutSpaces('StrIng in-De-x')->shouldBeEqualTo('string_in_de_x');
Loading history...
34
    }
35
}
36