You are here

public function ContextDefinitionTest::testDefaultValue in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php \Drupal\Tests\Core\Plugin\Context\ContextDefinitionTest::testDefaultValue()
  2. 9 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 201

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());
}