# responsive-menu/3.0.12/tests/app/Form/CheckboxTest.php

Responsive Menu – Create Mobile-Friendly Menu, version 3.0.12. 34 lines.

- Page: https://pluginprobe.com/plugins/responsive-menu/3.0.12/code/tests/app/Form/CheckboxTest.php
- Raw: https://pluginprobe.com/plugins/responsive-menu/3.0.12/raw/tests/app/Form/CheckboxTest.php
- Modified: 2016-08-20T23:47:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/responsive-menu/3.0.12/code/tests/app/Form/CheckboxTest.php#L10-L20`.

```php
<?php

use PHPUnit\Framework\TestCase;

class CheckboxTest extends TestCase {

  public function setUp() {
    $this->form_component = new ResponsiveMenu\Form\Checkbox;
  }

  public function testRendering() {
    $output = $this->form_component->render(new ResponsiveMenu\Models\Option('a', 1));
    $this->assertEquals("<div class='onoffswitch'>
            <input type='checkbox' class='checkbox onoffswitch-checkbox' id='a' name='menu[a]' value='on' />
            <label class='onoffswitch-label' for='a'>
                <span class='onoffswitch-inner'></span>
                <span class='onoffswitch-switch'></span>
            </label>
          </div>", $output);
  }

  public function testRenderingTurnedOn() {
    $output = $this->form_component->render(new ResponsiveMenu\Models\Option('a', 'on'));
    $this->assertEquals("<div class='onoffswitch'>
            <input type='checkbox' class='checkbox onoffswitch-checkbox' id='a' checked='checked' name='menu[a]' value='on' />
            <label class='onoffswitch-label' for='a'>
                <span class='onoffswitch-inner'></span>
                <span class='onoffswitch-switch'></span>
            </label>
          </div>", $output);
  }

}

```
