NodeFunctionTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 11
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testConstructor() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpMyAdmin\Tests\Navigation\Nodes;
6
7
use PhpMyAdmin\Config;
8
use PhpMyAdmin\Navigation\Nodes\NodeFunction;
9
use PhpMyAdmin\Tests\AbstractTestCase;
10
use PHPUnit\Framework\Attributes\CoversClass;
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\Attributes\CoversClass was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
#[CoversClass(NodeFunction::class)]
13
class NodeFunctionTest extends AbstractTestCase
14
{
15
    /**
16
     * Test for __construct
17
     */
18
    public function testConstructor(): void
19
    {
20
        $parent = new NodeFunction(new Config(), 'default');
21
        self::assertSame('/database/routines', $parent->link->route);
22
        self::assertSame(
23
            ['item_type' => 'FUNCTION', 'edit_item' => 1, 'db' => null, 'item_name' => null],
24
            $parent->link->params,
25
        );
26
        self::assertSame('/database/routines', $parent->icon->route);
27
        self::assertSame(
28
            ['item_type' => 'FUNCTION', 'execute_dialog' => 1, 'db' => null, 'item_name' => null],
29
            $parent->icon->params,
30
        );
31
    }
32
}
33