PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 3.0.12
Responsive Menu – Create Mobile-Friendly Menu v3.0.12
4.7.4 4.7.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 All 91 releases
responsive-menu / tests / app / Factories / CssFactoryTest.php

CssFactoryTest.php in Responsive Menu – Create Mobile-Friendly Menu 3.0.12, at tests/app/Factories/CssFactoryTest.php

36 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use PHPUnit\Framework\TestCase;
4 use ResponsiveMenu\Factories\CssFactory;
5 use ResponsiveMenu\Collections\OptionsCollection;
6 use ResponsiveMenu\Models\Option;
7
8 class CssFactoryTest extends TestCase {
9
10 public function setUp() {
11 $this->base_mapper = $this->createMock('ResponsiveMenu\Mappers\ScssBaseMapper');
12 $this->button_mapper = $this->createMock('ResponsiveMenu\Mappers\ScssButtonMapper');
13 $this->menu_mapper = $this->createMock('ResponsiveMenu\Mappers\ScssMenuMapper');
14 $this->minifier = $this->createMock('ResponsiveMenu\Formatters\Minify');
15
16 $this->base_mapper->method('map')->willReturn('a');
17 $this->button_mapper->method('map')->willReturn('b');
18 $this->menu_mapper->method('map')->willReturn('c');
19 $this->minifier->method('minify')->willReturn('d');
20 $this->factory = new CssFactory($this->minifier, $this->base_mapper, $this->button_mapper, $this->menu_mapper);
21 }
22
23 public function testMinified() {
24 $collection = new OptionsCollection;
25 $collection->add(new Option('minify_scripts', 'on'));
26 $this->assertequals('d', $this->factory->build($collection));
27 }
28
29 public function testNotMinified() {
30 $collection = new OptionsCollection;
31 $collection->add(new Option('minify_scripts', 'off'));
32 $this->assertequals('abc', $this->factory->build($collection));
33 }
34
35 }
36