Conditions | 1 |
Paths | 1 |
Total Lines | 40 |
Code Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function testGetThemeOptionsExcluding() |
||
28 | { |
||
29 | Config::modify()->set(SiteConfig::class, 'theme_colors', [ |
||
30 | 'color1' => [ |
||
31 | 'Title' => 'Color 1', |
||
32 | 'CSSClass' => 'color-1', |
||
33 | 'Color' => '#111111', |
||
34 | ], |
||
35 | 'color2' => [ |
||
36 | 'Title' => 'Color 2', |
||
37 | 'CSSClass' => 'color-2', |
||
38 | 'Color' => '#222222', |
||
39 | ], |
||
40 | ]); |
||
41 | $siteConfig = SiteConfig::create(); |
||
42 | |||
43 | // Returns all colors by default |
||
44 | $themeColors = $siteConfig->getThemeOptionsExcluding(); |
||
45 | $this->assertEquals([ |
||
46 | [ |
||
47 | 'Title' => 'Color 1', |
||
48 | 'CSSClass' => 'color-1', |
||
49 | 'Color' => '#111111', |
||
50 | ], |
||
51 | [ |
||
52 | 'Title' => 'Color 2', |
||
53 | 'CSSClass' => 'color-2', |
||
54 | 'Color' => '#222222', |
||
55 | ], |
||
56 | ], $themeColors); |
||
57 | |||
58 | // Returns colors without excludedColors |
||
59 | $themeColors = $siteConfig->getThemeOptionsExcluding(['color-1']); |
||
60 | $this->assertEquals([ |
||
61 | [ |
||
62 | 'Title' => 'Color 2', |
||
63 | 'CSSClass' => 'color-2', |
||
64 | 'Color' => '#222222', |
||
65 | ], |
||
66 | ], $themeColors); |
||
67 | } |
||
69 |