You are here

protected function EntityContextDefinitionIsSatisfiedTest::assertRequirementIsSatisfied in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php \Drupal\Tests\Core\Plugin\Context\EntityContextDefinitionIsSatisfiedTest::assertRequirementIsSatisfied()

Asserts that the requirement is satisfied as expected.

Parameters

bool $expected: The expected outcome.

\Drupal\Core\Plugin\Context\EntityContextDefinition $requirement: The requirement to check against.

\Drupal\Core\Plugin\Context\EntityContextDefinition $definition: The context definition to check.

mixed $value: (optional) The value to set on the context, defaults to NULL.

3 calls to EntityContextDefinitionIsSatisfiedTest::assertRequirementIsSatisfied()
EntityContextDefinitionIsSatisfiedTest::testIsSatisfiedBy in core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php
@covers ::isSatisfiedBy @covers ::dataTypeMatches @covers ::getSampleValues @covers ::getConstraintObjects
EntityContextDefinitionIsSatisfiedTest::testIsSatisfiedByGenerateBundledEntity in core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php
@covers ::isSatisfiedBy @covers ::dataTypeMatches @covers ::getSampleValues @covers ::getConstraintObjects
EntityContextDefinitionIsSatisfiedTest::testIsSatisfiedByPassBundledEntity in core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php
@covers ::isSatisfiedBy @covers ::dataTypeMatches @covers ::getSampleValues @covers ::getConstraintObjects

File

core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php, line 93

Class

EntityContextDefinitionIsSatisfiedTest
@coversDefaultClass \Drupal\Core\Plugin\Context\EntityContextDefinition @group Plugin

Namespace

Drupal\Tests\Core\Plugin\Context

Code

protected function assertRequirementIsSatisfied($expected, ContextDefinition $requirement, ContextDefinition $definition, $value = NULL) {
  $context = new EntityContext($definition, $value);
  $this
    ->assertSame($expected, $requirement
    ->isSatisfiedBy($context));
}