function EntityContextDefinitionIsSatisfiedTest::assertRequirementIsSatisfied
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php \Drupal\Tests\Core\Plugin\Context\EntityContextDefinitionIsSatisfiedTest::assertRequirementIsSatisfied()
- 8.9.x core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php \Drupal\Tests\Core\Plugin\Context\EntityContextDefinitionIsSatisfiedTest::assertRequirementIsSatisfied()
- 11.x core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php \Drupal\Tests\Core\Plugin\Context\EntityContextDefinitionIsSatisfiedTest::assertRequirementIsSatisfied()
Asserts that the requirement is satisfied as expected.
@internal
Parameters
bool $expected: The expected outcome.
\Drupal\Core\Plugin\Context\ContextDefinition $requirement: The requirement to check against.
\Drupal\Core\Plugin\Context\ContextDefinition $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 98
Class
- EntityContextDefinitionIsSatisfiedTest
- @coversDefaultClass \Drupal\Core\Plugin\Context\EntityContextDefinition @group Plugin
Namespace
Drupal\Tests\Core\Plugin\ContextCode
protected function assertRequirementIsSatisfied(bool $expected, ContextDefinition $requirement, ContextDefinition $definition, $value = NULL) : void {
$context = new EntityContext($definition, $value);
$this->assertSame($expected, $requirement->isSatisfiedBy($context));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.