function ContextDefinitionTest::testDefaultValue

Same name in other branches
  1. 8.9.x 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()
  3. 11.x 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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.