function ContextTest::testDefaultValue
@covers ::getContextValue
      
    
File
- 
              core/tests/ Drupal/ Tests/ Component/ Plugin/ Context/ ContextTest.php, line 122 
Class
- ContextTest
- @coversDefaultClass \Drupal\Component\Plugin\Context\Context[[api-linebreak]] @group Plugin
Namespace
Drupal\Tests\Component\Plugin\ContextCode
public function testDefaultValue() {
  $mock_definition = $this->getMockBuilder('Drupal\\Component\\Plugin\\Context\\ContextDefinitionInterface')
    ->onlyMethods([
    'getDefaultValue',
  ])
    ->getMockForAbstractClass();
  $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.
