You are here

protected function DisplayValueWidgetOrderProcessorTest::setUp in Facets 8

Creates a new processor object for use in the tests.

Overrides UnitTestCase::setUp

File

tests/src/Unit/Plugin/processor/DisplayValueWidgetOrderProcessorTest.php, line 35

Class

DisplayValueWidgetOrderProcessorTest
Unit test for processor.

Namespace

Drupal\Tests\facets\Unit\Plugin\processor

Code

protected function setUp() {
  parent::setUp();
  $facet = new Facet([], 'facets_facet');
  $this->originalResults = [
    new Result($facet, 'thetans', 'thetans', 10),
    new Result($facet, 'xenu', 'xenu', 5),
    new Result($facet, 'Tom', 'Tom', 15),
    new Result($facet, 'Hubbard', 'Hubbard', 666),
    new Result($facet, 'FALSE', 'FALSE', 1),
    new Result($facet, '1977', '1977', 20),
    new Result($facet, '2', '2', 22),
  ];
  $transliteration = $this
    ->getMockBuilder(TransliterationInterface::class)
    ->disableOriginalConstructor()
    ->getMock();
  $transliteration
    ->expects($this
    ->any())
    ->method('removeDiacritics')
    ->will($this
    ->returnArgument(0));
  $this->processor = new DisplayValueWidgetOrderProcessor([], 'display_value_widget_order', [], $transliteration);
}