# responsive-menu/3.0.12/tests/app/Factories/JsFactoryTest.php

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

- Page: https://pluginprobe.com/plugins/responsive-menu/3.0.12/code/tests/app/Factories/JsFactoryTest.php
- Raw: https://pluginprobe.com/plugins/responsive-menu/3.0.12/raw/tests/app/Factories/JsFactoryTest.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/Factories/JsFactoryTest.php#L10-L20`.

```php
<?php

use PHPUnit\Framework\TestCase;
use ResponsiveMenu\Factories\JsFactory;
use ResponsiveMenu\Collections\OptionsCollection;
use ResponsiveMenu\Models\Option;

class JsFactoryTest extends TestCase {

  public function setUp() {
      $this->mapper = $this->createMock('ResponsiveMenu\Mappers\JsMapper');
      $this->minifier = $this->createMock('ResponsiveMenu\Formatters\Minify');
      $this->mapper->method('map')->willReturn('a');
      $this->minifier->method('minify')->willReturn('b');
      $this->factory = new JsFactory($this->mapper, $this->minifier);
  }

  public function testMinified() {
    $collection = new OptionsCollection;
    $collection->add(new Option('minify_scripts', 'on'));
    $this->assertequals('b', $this->factory->build($collection));
  }

  public function testNotMinified() {
    $collection = new OptionsCollection;
    $collection->add(new Option('minify_scripts', 'off'));
    $this->assertequals('a', $this->factory->build($collection));
  }

}

```
