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

testConfiguratorBootstrapsModulePathsAndIcons()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 19
rs 9.8333
eloc 13
cc 1
nc 1
nop 0
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