You are here

public function ContextDefinitionTest::testDefaultValue in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php \Drupal\Tests\Core\Plugin\Context\ContextDefinitionTest::testDefaultValue()
  2. 10 core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php \Drupal\Tests\Core\Plugin\Context\ContextDefinitionTest::testDefaultValue()

@covers ::getDefaultValue @covers ::setDefaultValue

File

core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php, line 199

Class

ContextDefinitionTest
Tests the ContextDefinition class.

Namespace

Drupal\Tests\Core\Plugin\Context

Code

public function testDefaultValue() {
  $context_definition = new ContextDefinition();
  $this
    ->assertNull($context_definition
    ->getDefaultValue());
  $context_definition
    ->setDefaultValue('test');
  $this
    ->assertSame('test', $context_definition
    ->getDefaultValue());
}