HasPropertiesNamespacesTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_getPropertiesNamespaces() 0 13 1
1
<?php
2
3
namespace ByTIC\Models\SmartProperties\Tests\Definitions\Traits;
4
5
use ByTIC\Models\SmartProperties\Tests\Definitions\AbstractDefinitionTestCase;
6
7
/**
8
 * Class HasPropertiesNamespacesTest
9
 * @package ByTIC\Models\SmartProperties\Tests\Definitions\Traits
10
 */
11
class HasPropertiesNamespacesTest extends AbstractDefinitionTestCase
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
            [
19
                'ByTIC\Models\SmartProperties\Tests\Fixtures\RecordsTraits\HasTypes\\'
20
                => PROJECT_BASE_PATH
21
                    . DIRECTORY_SEPARATOR
22
                    . implode(DIRECTORY_SEPARATOR, ['vendor', 'mockery','mockery', 'library', 'Mockery', 'Loader'])
23
                    . DIRECTORY_SEPARATOR
24
            ],
25
            $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...
26
        );
27
    }
28
}
29