Passed
Push — master ( 81d3f9...4ab6f6 )
by Gabriel
11:06
created

HasPropertiesNamespacesTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_getPropertiesNamespaces() 0 7 1
1
<?php
2
3
namespace ByTIC\Models\SmartProperties\Tests\Definitions\Traits;
4
5
use ByTIC\Models\SmartProperties\Tests\Definitions\AbstractDefinitionTest;
6
7
/**
8
 * Class HasPropertiesNamespacesTest
9
 * @package ByTIC\Models\SmartProperties\Tests\Definitions\Traits
10
 */
11
class HasPropertiesNamespacesTest extends AbstractDefinitionTest
12
{
13
    public function test_getPropertiesNamespaces()
14
    {
15
        $definition = $this->newDefinitionWithManager();
16
        $definition->getManager()->shouldReceive('getPropertiesNamespaces')->andReturn(['test']);
0 ignored issues
show
Bug introduced by
The method andReturn() does not exist on Nip\Records\Collections\Collection. ( Ignorable by Annotation )

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

16
        $definition->getManager()->shouldReceive('getPropertiesNamespaces')->/** @scrutinizer ignore-call */ andReturn(['test']);

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...
17
        $this->assertEquals(
18
            ['ByTIC\Models\SmartProperties\Tests\Fixtures\RecordsTraits\HasTypes\\' => PROJECT_BASE_PATH . '\vendor\mockery\mockery\library\Mockery\Loader\\'],
19
            $definition->getPropertiesNamespaces()
0 ignored issues
show
Bug introduced by
Are you sure the usage of $definition->getPropertiesNamespaces() targeting ByTIC\Models\SmartProper...tPropertiesNamespaces() 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...
20
        );
21
    }
22
}
23