Failed Conditions
Push — master ( 2cff37...0099f4 )
by Guillermo A.
01:58
created

DumpableTraitTest::testDump()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Test\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());
1 ignored issue
show
Bug introduced by
The method dump() does not exist on PHPUnit\Framework\MockObject\MockObject. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

13
        $this->assertSame(var_dump($dumpable), $dumpable->/** @scrutinizer ignore-call */ dump());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
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...
Security Debugging Code introduced by
var_dump($dumpable) looks like debug code. Are you sure you do not want to remove it?
Loading history...
14
    }
15
}
16