You are here

public function GroupTypeConditionTest::testConditions in Organic groups 8

Tests conditions.

@dataProvider conditionsProvider

File

tests/src/Kernel/GroupTypeConditionTest.php, line 105

Class

GroupTypeConditionTest
Tests the GroupType condition plugin.

Namespace

Drupal\Tests\og\Kernel

Code

public function testConditions($group_types, $negate, $context_value, $expected) {

  // Create an instance of the group type condition plugin.

  /** @var \Drupal\og\Plugin\Condition\GroupType $plugin_instance */
  $plugin_instance = $this->conditionManager
    ->createInstance('og_group_type')
    ->setConfig('group_types', array_combine($group_types, $group_types))
    ->setConfig('negate', $negate)
    ->setContextValue('og', $this->groups[$context_value]);
  $this
    ->assertEquals($expected, $plugin_instance
    ->execute());
}