GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 1537c6...c1251f )
by
unknown
07:51
created

ChartRendererSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace spec\Odiseo\SyliusReportPlugin\Renderer;
4
5
use Odiseo\SyliusReportPlugin\DataFetcher\Data;
6
use Odiseo\SyliusReportPlugin\Form\Type\Renderer\ChartConfigurationType;
7
use Odiseo\SyliusReportPlugin\Model\ReportInterface;
8
use Odiseo\SyliusReportPlugin\Renderer\ChartRenderer;
9
use Odiseo\SyliusReportPlugin\Renderer\RendererInterface;
10
use PhpSpec\ObjectBehavior;
11
use Symfony\Component\Templating\EngineInterface;
12
13
/**
14
 * @author Mateusz Zalewski <[email protected]>
15
 * @author Łukasz Chruściel <[email protected]>
16
 * @author Diego D'amico <[email protected]>
17
 */
18
final class ChartRendererSpec extends ObjectBehavior
19
{
20
    function let(EngineInterface $templating)
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...
21
    {
22
        $this->beConstructedWith($templating);
23
    }
24
25
    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...
26
    {
27
        $this->shouldHaveType(ChartRenderer::class);
28
    }
29
30
    function it_should_implement_renderer_interface()
31
    {
32
        $this->shouldImplement(RendererInterface::class);
33
    }
34
35
    function it_renders_data_with_given_configuration(ReportInterface $report, Data $reportData, $templating)
36
    {
37
        $reportData->getData()->willReturn(['month1' => '50', 'month2' => '40']);
38
39
        $renderData = [
40
            'report' => $report,
41
            'values' => ['month1' => '50', 'month2' => '40'],
42
            'labels' => ['month1', 'month2'],
43
        ];
44
45
        $report->getRendererConfiguration()->willReturn(['template' => '@OdiseoSyliusReportPlugin/Chart/default.html.twig']);
46
47
        $templating->render('@OdiseoSyliusReportPlugin/Chart/default.html.twig', [
48
            'data' => $renderData,
49
            'configuration' => ['template' => '@OdiseoSyliusReportPlugin/Chart/default.html.twig'],
50
        ])->willReturn('<div>Chart Report</div>');
51
52
        $this->render($report, $reportData)->shouldReturn('<div>Chart Report</div>');
0 ignored issues
show
Bug introduced by
The method render() does not exist on spec\Odiseo\SyliusReport...derer\ChartRendererSpec. 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

52
        $this->/** @scrutinizer ignore-call */ 
53
               render($report, $reportData)->shouldReturn('<div>Chart Report</div>');
Loading history...
53
    }
54
55
    function it_is_a_chart_type()
56
    {
57
        $this->getType()->shouldReturn(ChartConfigurationType::class);
0 ignored issues
show
Bug introduced by
The method getType() does not exist on spec\Odiseo\SyliusReport...derer\ChartRendererSpec. 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

57
        $this->/** @scrutinizer ignore-call */ 
58
               getType()->shouldReturn(ChartConfigurationType::class);
Loading history...
58
    }
59
}
60