function EntityConditionGroupTest::testConstruct

Same name in other branches
  1. 9 core/modules/jsonapi/tests/src/Unit/Query/EntityConditionGroupTest.php \Drupal\Tests\jsonapi\Unit\Query\EntityConditionGroupTest::testConstruct()
  2. 8.9.x core/modules/jsonapi/tests/src/Unit/Query/EntityConditionGroupTest.php \Drupal\Tests\jsonapi\Unit\Query\EntityConditionGroupTest::testConstruct()
  3. 10 core/modules/jsonapi/tests/src/Unit/Query/EntityConditionGroupTest.php \Drupal\Tests\jsonapi\Unit\Query\EntityConditionGroupTest::testConstruct()

@covers ::__construct @dataProvider constructProvider

File

core/modules/jsonapi/tests/src/Unit/Query/EntityConditionGroupTest.php, line 22

Class

EntityConditionGroupTest
@coversDefaultClass \Drupal\jsonapi\Query\EntityConditionGroup @group jsonapi

Namespace

Drupal\Tests\jsonapi\Unit\Query

Code

public function testConstruct($case) : void {
    $group = new EntityConditionGroup($case['conjunction'], $case['members']);
    $this->assertEquals($case['conjunction'], $group->conjunction());
    foreach ($group->members() as $key => $condition) {
        $this->assertEquals($case['members'][$key]['path'], $condition->field());
        $this->assertEquals($case['members'][$key]['value'], $condition->value());
    }
}

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