function ConfigTargetTest::testSetValueCorrectConfig
Same name and namespace in other branches
- 10 core/tests/Drupal/Tests/Core/Form/ConfigTargetTest.php \Drupal\Tests\Core\Form\ConfigTargetTest::testSetValueCorrectConfig()
File
-
core/
tests/ Drupal/ Tests/ Core/ Form/ ConfigTargetTest.php, line 235
Class
- ConfigTargetTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Form%21ConfigTarget.php/class/ConfigTarget/11.x" title="Represents the mapping of a config property to a form element." class="local">\Drupal\Core\Form\ConfigTarget</a> @group Form
Namespace
Drupal\Tests\Core\FormCode
public function testSetValueCorrectConfig() : void {
$sut = new ConfigTarget('foo.settings', $this->randomMachineName());
$config = $this->prophesize(Config::class);
$config->getName()
->willReturn('bar.settings');
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Config target is associated with foo.settings but bar.settings given.');
$sut->setValue($config->reveal(), $this->randomString(), $this->prophesize(FormStateInterface::class)
->reveal());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.