| 1 |
<?php |
| 2 |
|
| 3 |
namespace ResponsiveMenu\ViewModels\Components\Admin; |
| 4 |
|
| 5 |
use PHPUnit\Framework\TestCase; |
| 6 |
use ResponsiveMenu\Models\Option; |
| 7 |
use ResponsiveMenu\Collections\OptionsCollection; |
| 8 |
|
| 9 |
class BoxesTest extends TestCase { |
| 10 |
|
| 11 |
public function setUp() { |
| 12 |
$this->collection = new OptionsCollection; |
| 13 |
$this->collection->add(new Option('a_three', 'a value')); |
| 14 |
$this->collection->add(new Option('b_three', 'b value')); |
| 15 |
|
| 16 |
$this->component = new Boxes( |
| 17 |
[ |
| 18 |
'a one' => [ |
| 19 |
'a two' => [ |
| 20 |
[ |
| 21 |
'type' => 'text', |
| 22 |
'option' => 'a_three', |
| 23 |
'title' => 'a three title', |
| 24 |
'label' => 'a three label', |
| 25 |
] |
| 26 |
] |
| 27 |
], |
| 28 |
'b one' => [ |
| 29 |
'b two' => [ |
| 30 |
[ |
| 31 |
'type' => 'colour', |
| 32 |
'option' => 'b_three', |
| 33 |
'title' => 'b three title', |
| 34 |
'label' => 'b three label', |
| 35 |
] |
| 36 |
] |
| 37 |
] |
| 38 |
], $this->collection); |
| 39 |
} |
| 40 |
|
| 41 |
public function testRender() { |
| 42 |
|
| 43 |
$rendered = $this->component->render(); |
| 44 |
$this->assertContains('tab_container_a_one"', $rendered); |
| 45 |
$this->assertContains('id="b_three_container"', $rendered); |
| 46 |
$this->assertContains('<div class="label">a three title</div>', $rendered); |
| 47 |
$this->assertContains('<div class="label">b three title</div>', $rendered); |
| 48 |
} |
| 49 |
|
| 50 |
} |
| 51 |
|