function ConfigActionsTest::testConfigActions

Same name in this branch
  1. 11.x core/modules/media/tests/src/Kernel/ConfigActionsTest.php \Drupal\Tests\media\Kernel\ConfigActionsTest::testConfigActions()
  2. 11.x core/modules/field/tests/src/Kernel/ConfigActionsTest.php \Drupal\Tests\field\Kernel\ConfigActionsTest::testConfigActions()
  3. 11.x core/modules/contact/tests/src/Kernel/ConfigActionsTest.php \Drupal\Tests\contact\Kernel\ConfigActionsTest::testConfigActions()
  4. 11.x core/modules/node/tests/src/Kernel/ConfigActionsTest.php \Drupal\Tests\node\Kernel\ConfigActionsTest::testConfigActions()
  5. 11.x core/modules/image/tests/src/Kernel/ConfigActionsTest.php \Drupal\Tests\image\Kernel\ConfigActionsTest::testConfigActions()

File

core/modules/language/tests/src/Kernel/ConfigActionsTest.php, line 32

Class

ConfigActionsTest
@group language

Namespace

Drupal\Tests\language\Kernel

Code

public function testConfigActions() : void {
    $language = ConfigurableLanguage::load('en');
    $this->assertSame('English', $language->getName());
    $this->assertSame(0, $language->getWeight());
    $this->configActionManager
        ->applyAction('entity_method:language.entity:setName', $language->getConfigDependencyName(), 'Wacky language');
    $this->configActionManager
        ->applyAction('entity_method:language.entity:setWeight', $language->getConfigDependencyName(), 39);
    $language = ConfigurableLanguage::load('en');
    $this->assertSame('Wacky language', $language->getName());
    $this->assertSame(39, $language->getWeight());
}

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