Exemple #1
0
 /**
  * @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());
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function hasContextValue()
 {
     return (bool) $this->contextData || parent::hasContextValue();
 }