/** * @covers ::getContextValue */ public function testDefaultValue() { $mock_definition = $this->getMockBuilder('Drupal\\Component\\Plugin\\Context\\ContextDefinitionInterface')->setMethods(array('getDefaultValue'))->getMockForAbstractClass(); $mock_definition->expects($this->once())->method('getDefaultValue')->willReturn('test'); $context = new Context($mock_definition); $this->assertEquals('test', $context->getContextValue()); }
/** * {@inheritdoc} */ public function hasContextValue() { return (bool) $this->contextData || parent::hasContextValue(); }