Completed
Push — master ( 66cd91...6aa991 )
by Gabriel
01:42
created

ModulesManagerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_loadFromConfig() 0 6 1
A prepareConfig() 0 5 1
1
<?php
2
3
namespace Nip\Mvc\Tests\Modules;
4
5
use Nip\Config\Config;
6
use Nip\Container\Container;
7
use Nip\Mvc\Modules\ModulesManager;
8
use Nip\Mvc\Sections\SectionsManager;
9
use Nip\Mvc\Tests\AbstractTest;
10
11
/**
12
 * Class ModulesManagerTest
13
 * @package Nip\Mvc\Tests\Modules
14
 */
15
class ModulesManagerTest extends AbstractTest
16
{
17
    public function test_loadFromConfig()
18
    {
19
        $this->prepareConfig();
20
        $manager = new ModulesManager();
21
22
        self::assertCount(3, $manager->getModules());
23
    }
24
25
    /**
26
     * @param string $file
27
     */
28
    protected function prepareConfig($file = 'basic')
29
    {
30
        $data = require TEST_FIXTURE_PATH . DIRECTORY_SEPARATOR. 'config'. DIRECTORY_SEPARATOR . $file.'.php';
31
        $config = new Config(['mvc' => $data]);
32
        Container::getInstance()->set('config', $config);
33
    }
34
}