You are here

public function ResultTest::testCreation in Facets 8

Test facet creation.

File

tests/src/Unit/Result/ResultTest.php, line 20

Class

ResultTest
Class ResultTest.

Namespace

Drupal\Tests\facets\Unit\Result

Code

public function testCreation() {
  $facet = new Facet([
    'id' => 'foo',
  ], 'facets_facet');
  $result = new Result($facet, 11, 'Eleven', '3.11');
  $this
    ->assertInstanceOf(Result::class, $result);
  $this
    ->assertSame(11, $result
    ->getRawValue());
  $this
    ->assertSame('Eleven', $result
    ->getDisplayValue());
  $this
    ->assertSame(3, $result
    ->getCount());
  $this
    ->assertSame($facet, $result
    ->getFacet());
}