Passed
Push — master ( ebb63d...279168 )
by Guillermo A.
02:08
created

DumpableTraitTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testDump() 0 4 1
1
<?php
2
3
namespace GuillermoandraeTest\Common;
4
5
use Guillermoandrae\Common\DumpableTrait;
6
use PHPUnit\Framework\TestCase;
7
8
class DumpableTraitTest extends TestCase
9
{
10
    public function testDump()
11
    {
12
        $dumpable = $this->getMockForTrait(DumpableTrait::class);
13
        $this->assertSame(var_dump($dumpable), $dumpable->dump());
0 ignored issues
show
Bug introduced by
Are you sure the usage of var_dump($dumpable) is correct as it 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...
14
    }
15
}
16