PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 3.0.12
Responsive Menu – Create Mobile-Friendly Menu v3.0.12
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 4.2.0 All 90 releases
responsive-menu / tests / app / Controllers / AdminTest.php

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

52 lines 1.4 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\Collections\OptionsCollection;
5 use ResponsiveMenu\Models\Option;
6
7 class AdminTest extends TestCase {
8
9 static public function setUpBeforeClass() {
10 function __($a, $b) {
11 return $a;
12 }
13 }
14 public function setUp() {
15 $this->view = $this->createMock('ResponsiveMenu\View\AdminView');
16 $this->service = $this->createMock('ResponsiveMenu\Services\OptionService');
17 $this->view->method('render')->willReturn(true);
18 $this->view->method('display')->will($this->returnArgument(0));
19 $this->service->method('combineOptions')->willReturn([]);
20 $collection = new OptionsCollection;
21 $collection->add(new Option('a', 1));
22 $this->service->method('all')->willReturn($collection);
23 $this->controller = new ResponsiveMenu\Controllers\Admin($this->service, $this->view);
24
25 }
26
27 public function testUpdate() {
28 $this->assertTrue($this->controller->update([],[]));
29 }
30
31 public function testReset() {
32 $this->assertTrue($this->controller->reset([]));
33 }
34
35 public function testIndex() {
36 $this->assertTrue($this->controller->index([]));
37 }
38
39 public function testExport() {
40 $this->assertNull($this->controller->export());
41 }
42
43 public function testImportNoFile() {
44 $this->assertTrue($this->controller->import(['a' => 1], null));
45 }
46
47 public function testImport() {
48 $this->assertTrue($this->controller->import(['a' => 1], ['b' => 2]));
49 }
50
51 }
52