public function ContextDefinitionTest::testGetConstraint in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php \Drupal\Tests\Core\Plugin\Context\ContextDefinitionTest::testGetConstraint()
- 9 core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php \Drupal\Tests\Core\Plugin\Context\ContextDefinitionTest::testGetConstraint()
@dataProvider providerGetConstraint @covers ::getConstraint @uses \Drupal
File
- core/
tests/ Drupal/ Tests/ Core/ Plugin/ Context/ ContextDefinitionTest.php, line 183
Class
- ContextDefinitionTest
- Tests the ContextDefinition class.
Namespace
Drupal\Tests\Core\Plugin\ContextCode
public function testGetConstraint($expected, $constraint_array, $constraint) {
$mock_context_definition = $this
->getMockBuilder('Drupal\\Core\\Plugin\\Context\\ContextDefinition')
->disableOriginalConstructor()
->onlyMethods([
'getConstraints',
])
->getMock();
$mock_context_definition
->expects($this
->once())
->method('getConstraints')
->willReturn($constraint_array);
$this
->assertEquals($expected, $mock_context_definition
->getConstraint($constraint));
}