NullStringControllerModelTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 26
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanBeCreated() 0 8 1
A testReturnsResponseParameters() 0 14 1
1
<?php
2
3
/*
4
 * This file is part of the Symfony-Util package.
5
 *
6
 * (c) Jean-Bernard Addor
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
use PHPUnit\Framework\TestCase;
13
use Symfony\Component\HttpFoundation\Request;
14
use SymfonyUtil\Component\HttpFoundation\NullStringControllerModel;
15
16
/**
17
 * @covers \SymfonyUtil\Component\HttpFoundation\NullStringControllerModel
18
 */
19
final class NullStringControllerModelTest extends TestCase
20
{
21
    public function testCanBeCreated()
22
    {
23
        $this->assertInstanceOf(
24
            // ::class, // 5.4 < php
25
            'SymfonyUtil\Component\HttpFoundation\NullStringControllerModel',
26
            new NullStringControllerModel('')
0 ignored issues
show
Unused Code introduced by
The call to NullStringControllerModel::__construct() has too many arguments starting with ''.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
27
        );
28
    }
29
30
    public function testReturnsResponseParameters()
31
    {
32
        $this->assertInstanceOf(
33
            // ::class, // 5.4 < php
34
            'SymfonyUtil\Component\HttpFoundation\ResponseParameters',
35
            (new NullStringControllerModel())->__invoke('', new Request())
36
        );
37
        /*
38
        $this->assertInternalType('array', (new NullStringControllerModel())->__invoke('', new Request()));
39
        $this->assertSame([], (new NullStringControllerModel())->__invoke('', new Request()));
40
        $this->assertSame(0, count((new NullStringControllerModel())->__invoke('', new Request())));
41
        $this->assertEmpty((new NullStringControllerModel())->__invoke('', new Request()));
42
        */
43
    }
44
}
45