Passed
Push — codex/explain-codebase-structu... ( a4c6f1...5ea8d4 )
by Michael
08:21
created

ConfiguratorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testConfiguratorBootstrapsModulePathsAndIcons() 0 19 1
1
<?php
2
3
declare(strict_types=1);
4
5
use PHPUnit\Framework\TestCase;
6
use XoopsModules\Pedigree\Common\Configurator;
7
8
final class ConfiguratorTest extends TestCase
9
{
10
    public function testConfiguratorBootstrapsModulePathsAndIcons(): void
11
    {
12
        $configurator = new Configurator();
13
14
        self::assertSame('PEDIGREE ModuleConfigurator', $configurator->name);
15
        self::assertNotNull($configurator->paths, 'Paths configuration should be initialised.');
16
        self::assertNotNull($configurator->icons, 'Icon configuration should be initialised.');
17
18
        $uploadFolders = $configurator->uploadFolders;
19
        self::assertTrue(in_array(XOOPS_UPLOAD_PATH . '/pedigree/pedigree_config', $uploadFolders, true));
20
21
        $paths = (array)$configurator->paths->paths;
22
        self::assertSame(XOOPS_ROOT_PATH . '/modules/pedigree', $paths['modPath']);
23
        self::assertSame(XOOPS_URL . '/modules/pedigree', $paths['modUrl']);
24
25
        $icons = (array)$configurator->icons;
26
        self::assertArrayHasKey('edit', $icons);
27
        self::assertArrayHasKey('delete', $icons);
28
        self::assertArrayHasKey('add', $icons);
29
    }
30
}
31