TestFixtures   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 32
dl 0
loc 78
rs 10
c 2
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getImages() 0 7 1
A getNavigationTree() 0 29 1
A getUsers() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Tests\Fixtures;
13
14
use Symfony\Component\Security\Core\User\UserInterface;
15
use Throwable;
16
use WBW\Bundle\CoreBundle\Tests\Fixtures\Model\TestUser;
17
use WBW\Library\Symfony\Assets\Navigation\DividerNode;
18
use WBW\Library\Symfony\Assets\Navigation\HeaderNode;
19
use WBW\Library\Symfony\Assets\Navigation\NavigationNode;
20
use WBW\Library\Symfony\Assets\Navigation\NavigationTree;
21
use WBW\Library\Symfony\Assets\NavigationNodeInterface;
22
23
/**
24
 * Test fixtures.
25
 *
26
 * @author webeweb <https://github.com/webeweb>
27
 * @package WBW\Bundle\CoreBundle\Tests\Fixtures
28
 */
29
class TestFixtures {
30
31
    /**
32
     * Get the images.
33
     *
34
     * @return string[]
35
     */
36
    public static function getImages(): array {
37
38
        return [
39
            __DIR__ . "/Model/TestImage_1920x1037.jpg",
40
            __DIR__ . "/Model/TestImage_1920x1037.png",
41
            __DIR__ . "/Model/TestImage_1920x1920.png",
42
            __DIR__ . "/Model/TestImage_1920x3554.png",
43
        ];
44
    }
45
46
    /**
47
     * Get a navigation tree.
48
     * GitHub
49
     * |- AdminBSB Material Design bundle
50
     * |- Bootstrap bundle
51
     * |- EDM bundle
52
     * |- Highcharts bundle
53
     * |- jQuery DataTables bundle
54
     * |- jQuery QueryBuilder bundle
55
     * |- SyntaxHighlighter bundle
56
     * |- Core library
57
     * |- cURL library
58
     * |- FTP library
59
     * |- fPDF library
60
     * |- SkiData library
61
     * |- sMsmode library
62
     *
63
     * @return NavigationTree Returns the navigation tree.
64
     */
65
    public static function getNavigationTree(): NavigationTree {
66
67
        $tree = new NavigationTree("tree");
68
69
        $tree->addNode(new NavigationNode("GitHub", null, NavigationNodeInterface::DEFAULT_HREF));
70
71
        $tree->getLastNode()->addNode(new HeaderNode("GitHub"));
72
        $tree->getLastNode()->addNode(new DividerNode("Bundles"));
73
        $tree->getLastNode()->addNode(new NavigationNode("AdminBSB Material Design bundle", null, "https://github.com/webeweb/adminbsb-material-design-bundle"));
74
        $tree->getLastNode()->addNode(new NavigationNode("Bootstrap bundle", null, "https://github.com/webeweb/bootstrap-bundle"));
75
        $tree->getLastNode()->addNode(new NavigationNode("Core bundle", null, "https://github.com/webeweb/core-bundle"));
76
        $tree->getLastNode()->addNode(new NavigationNode("EDM bundle", null, "https://github.com/webeweb/edm-bundle"));
77
        $tree->getLastNode()->addNode(new NavigationNode("HaveIBeenPwnd bundle", null, "https://github.com/webeweb/haveibeenpwned-bundle"));
78
        $tree->getLastNode()->addNode(new NavigationNode("Highcharts bundle", null, "https://github.com/webeweb/highcharts-bundle"));
79
        $tree->getLastNode()->addNode(new NavigationNode("jQuery DataTables bundle", null, "https://github.com/webeweb/jquery-datatables-bundle"));
80
        $tree->getLastNode()->addNode(new NavigationNode("jQuery QueryBuilder bundle", null, "https://github.com/webeweb/jquery-querybuilder-bundle"));
81
        $tree->getLastNode()->addNode(new NavigationNode("OpenData bundle", null, "https://github.com/webeweb/opendata-bundle"));
82
        $tree->getLastNode()->addNode(new NavigationNode("SyntaxHighlighter bundle", null, "https://github.com/webeweb/syntaxhighlighter-bundle"));
83
        $tree->getLastNode()->addNode(new DividerNode("Libraries"));
84
        $tree->getLastNode()->addNode(new NavigationNode("Chart accounts library", null, "https://github.com/webeweb/chart-accounts-library"));
85
        $tree->getLastNode()->addNode(new NavigationNode("Core library", null, "https://github.com/webeweb/core-library"));
86
        $tree->getLastNode()->addNode(new NavigationNode("cURL library", null, "https://github.com/webeweb/curl-library"));
87
        $tree->getLastNode()->addNode(new NavigationNode("FTP library", null, "https://github.com/webeweb/ftp-library"));
88
        $tree->getLastNode()->addNode(new NavigationNode("fPDF library", null, "https://github.com/webeweb/fpdf-library"));
89
        $tree->getLastNode()->addNode(new NavigationNode("HaveIBeenPwnd library", null, "https://github.com/webeweb/haveibeenpwned-library"));
90
        $tree->getLastNode()->addNode(new NavigationNode("SkiData library", null, "https:\/\/github\.com\/webeweb\/skidata-library", NavigationNodeInterface::MATCHER_REGEXP));
91
        $tree->getLastNode()->addNode(new NavigationNode("sMsmode library", null, "https://github.com/webeweb/smsmode-library", NavigationNodeInterface::MATCHER_ROUTER));
92
93
        return $tree;
94
    }
95
96
    /**
97
     * Get the users.
98
     *
99
     * @return UserInterface[] Returns the users.
100
     * @throws Throwable Throws an exception if an error occurs.
101
     */
102
    public static function getUsers(): array {
103
104
        $user = new TestUser();
105
106
        return [$user];
107
    }
108
}
109