function ContextTest::testDefaultValue
Same name in this branch
- 10 core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php \Drupal\Tests\Core\Plugin\Context\ContextTest::testDefaultValue()
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php \Drupal\Tests\Core\Plugin\Context\ContextTest::testDefaultValue()
- 9 core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php \Drupal\Tests\Component\Plugin\Context\ContextTest::testDefaultValue()
- 8.9.x core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php \Drupal\Tests\Core\Plugin\Context\ContextTest::testDefaultValue()
- 8.9.x core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php \Drupal\Tests\Component\Plugin\Context\ContextTest::testDefaultValue()
- 11.x core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php \Drupal\Tests\Core\Plugin\Context\ContextTest::testDefaultValue()
- 11.x core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php \Drupal\Tests\Component\Plugin\Context\ContextTest::testDefaultValue()
@covers ::getContextValue
File
-
core/
tests/ Drupal/ Tests/ Component/ Plugin/ Context/ ContextTest.php, line 119
Class
- ContextTest
- @coversDefaultClass \Drupal\Component\Plugin\Context\Context @group Plugin
Namespace
Drupal\Tests\Component\Plugin\ContextCode
public function testDefaultValue() : void {
$mock_definition = $this->createMock('Drupal\\Component\\Plugin\\Context\\ContextDefinitionInterface');
$mock_definition->expects($this->once())
->method('getDefaultValue')
->willReturn('test');
$context = new Context($mock_definition);
$this->assertEquals('test', $context->getContextValue());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.