Passed
Push — master ( 6215ec...1255dc )
by Darío
01:47
created

ModuleTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGettingConfiguration() 0 14 1
1
<?php
2
/**
3
 * DronePHP (http://www.dronephp.com)
4
 *
5
 * @link      http://github.com/Pleets/DronePHP
6
 * @copyright Copyright (c) 2016-2018 Pleets. (http://www.pleets.org)
7
 * @license   http://www.dronephp.com/license
8
 * @author    Darío Rivera <[email protected]>
9
 */
10
11
namespace DroneTest\Util;
12
13
use Drone\Mvc\Router;
14
use Drone\Mvc\ModuleFactory;
15
use PHPUnit\Framework\TestCase;
16
17
class ModuleTest extends TestCase
18
{
19
    /**
20
     * Tests getting module configuration
21
     *
22
     * @return null
23
     */
24
    public function testGettingConfiguration()
25
    {
26
        include "test-skeleton/module/Master/Module.php";
27
28
        $module = ModuleFactory::create("Master", [
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $module is correct as Drone\Mvc\ModuleFactory:...er/config/config.php')) targeting Drone\Mvc\ModuleFactory::create() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

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

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

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

Loading history...
29
            "config"  => 'test-skeleton/module/Master/config/config.php'
30
        ]);
31
32
        $this->assertSame(
33
            'test-skeleton/module/Master/config/config.php',
34
            $module->getConfigFile()
35
        );
36
37
        $this->assertSame(["baz" => "foo"], $module->getConfig());
38
    }
39
}