You are here

public function FilterTest::setUp in JSON:API 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::setUp()

Overrides KernelTestBase::setUp

File

tests/src/Kernel/Query/FilterTest.php, line 53

Class

FilterTest
@coversDefaultClass \Drupal\jsonapi\Query\Filter @group jsonapi @group jsonapi_query @group legacy

Namespace

Drupal\Tests\jsonapi\Kernel\Query

Code

public function setUp() {
  parent::setUp();
  $this
    ->setUpSchemas();
  $this
    ->savePaintingType();

  // ((RED or CIRCLE) or (YELLOW and SQUARE))
  $this
    ->savePaintings([
    [
      'colors' => [
        'red',
      ],
      'shapes' => [
        'triangle',
      ],
      'title' => 'FIND',
    ],
    [
      'colors' => [
        'orange',
      ],
      'shapes' => [
        'circle',
      ],
      'title' => 'FIND',
    ],
    [
      'colors' => [
        'orange',
      ],
      'shapes' => [
        'triangle',
      ],
      'title' => 'DONT_FIND',
    ],
    [
      'colors' => [
        'yellow',
      ],
      'shapes' => [
        'square',
      ],
      'title' => 'FIND',
    ],
    [
      'colors' => [
        'yellow',
      ],
      'shapes' => [
        'triangle',
      ],
      'title' => 'DONT_FIND',
    ],
    [
      'colors' => [
        'orange',
      ],
      'shapes' => [
        'square',
      ],
      'title' => 'DONT_FIND',
    ],
  ]);
  $this->nodeStorage = $this->container
    ->get('entity_type.manager')
    ->getStorage('node');
  $this->fieldResolver = $this->container
    ->get('jsonapi.field_resolver');
}