SsrRenderTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 5
dl 0
loc 34
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B testRender() 0 31 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: polidog
5
 * Date: 2017/02/22.
6
 */
7
8
namespace Polidog\SsrBundle\Tests\Render;
9
10
use Koriym\Baracoa\BaracoaInterface;
11
use PHPUnit\Framework\TestCase;
12
use Polidog\SsrBundle\Annotations\Ssr;
13
use Polidog\SsrBundle\Render\SsrRender;
14
use Prophecy\Argument;
15
16
class SsrRenderTest extends TestCase
17
{
18
    public function testRender()
19
    {
20
        $app = 'index_ssr';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
21
        $meta = ['title'];
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
22
        $state = ['hello'];
23
24
        $parameters = [
25
            'title' => 'hogehoge',
26
            'hello' => [
27
                'name' => 'polidog',
28
            ],
29
        ];
30
31
        $baracoa = $this->prophesize(BaracoaInterface::class);
32
        $baracoa->render(Argument::any(), Argument::any(), Argument::any())
33
            ->willReturn('string');
34
35
        $ssr = new Ssr([]);
36
        $ssr->setApp($app);
37
        $ssr->setMetas($meta);
38
        $ssr->setState($state);
39
40
        $ssrRender = new SsrRender($baracoa->reveal());
41
        $ssrRender->render($ssr, $parameters);
42
43
        $baracoa->render(
44
            $ssr->getApp(),
45
            ['hello' => ['name' => 'polidog']],
46
            ['title' => 'hogehoge']
47
        )->shouldHaveBeenCalled();
48
    }
49
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
50