Completed
Push — master ( 47fb92...85e008 )
by Adrien
09:22
created

BookableTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCode() 0 16 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApplicationTest\Model;
6
7
use Application\Model\Bookable;
8
use PHPUnit\Framework\TestCase;
9
10
class BookableTest extends TestCase
11
{
12
    public function testCode(): void
13
    {
14
        $bookable = new Bookable();
15
        self::assertNull($bookable->getCode());
16
17
        $bookable->setCode('foo');
18
        self::assertSame('foo', $bookable->getCode());
19
20
        $bookable->setCode('');
21
        self::assertNull($bookable->getCode());
22
23
        $bookable->setCode('foo');
24
        self::assertSame('foo', $bookable->getCode());
25
26
        $bookable->setCode(null);
27
        self::assertNull($bookable->getCode());
0 ignored issues
show
Bug introduced by
Are you sure the usage of $bookable->getCode() targeting Application\Model\Bookable::getCode() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
28
    }
29
}
30