function FilterTest::setUp

Same name in this branch
  1. 9 core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FilterTest::setUp()
  2. 9 core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::setUp()
Same name and namespace in other branches
  1. 8.9.x core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::setUp()
  2. 8.9.x core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::setUp()
  3. 10 core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::setUp()
  4. 10 core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FilterTest::setUp()
  5. 10 core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::setUp()
  6. 11.x core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php \Drupal\Tests\jsonapi\Kernel\Query\FilterTest::setUp()
  7. 11.x core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FilterTest::setUp()
  8. 11.x core/modules/views/tests/src/Functional/Plugin/FilterTest.php \Drupal\Tests\views\Functional\Plugin\FilterTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php, line 64

Class

FilterTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21jsonapi%21src%21Query%21Filter.php/class/Filter/9" title="Gathers information about the filter parameter." class="local">\Drupal\jsonapi\Query\Filter</a> @group jsonapi @group jsonapi_query

Namespace

Drupal\Tests\jsonapi\Kernel\Query

Code

public function setUp() : void {
    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' => 'DO_NOT_FIND',
        ],
        [
            'colors' => [
                'yellow',
            ],
            'shapes' => [
                'square',
            ],
            'title' => 'FIND',
        ],
        [
            'colors' => [
                'yellow',
            ],
            'shapes' => [
                'triangle',
            ],
            'title' => 'DO_NOT_FIND',
        ],
        [
            'colors' => [
                'orange',
            ],
            'shapes' => [
                'square',
            ],
            'title' => 'DO_NOT_FIND',
        ],
    ]);
    $this->nodeStorage = $this->container
        ->get('entity_type.manager')
        ->getStorage('node');
    $this->fieldResolver = $this->container
        ->get('jsonapi.field_resolver');
    $this->resourceTypeRepository = $this->container
        ->get('jsonapi.resource_type.repository');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.