function ActionValidationTest::providerInvalidMachineNameCharacters

Same name in other branches
  1. 11.x core/modules/system/tests/src/Kernel/Entity/ActionValidationTest.php \Drupal\Tests\system\Kernel\Entity\ActionValidationTest::providerInvalidMachineNameCharacters()

Action IDs are atypical in that they allow periods in the machine name.

Overrides ConfigEntityValidationTestBase::providerInvalidMachineNameCharacters

File

core/modules/system/tests/src/Kernel/Entity/ActionValidationTest.php, line 36

Class

ActionValidationTest
Tests validation of action entities.

Namespace

Drupal\Tests\system\Kernel\Entity

Code

public static function providerInvalidMachineNameCharacters() : array {
    $cases = parent::providerInvalidMachineNameCharacters();
    // Remove the existing test case that verifies a machine name containing
    // periods is invalid.
    self::assertSame([
        'period.separated',
        FALSE,
    ], $cases['INVALID: period separated']);
    unset($cases['INVALID: period separated']);
    // And instead add a test case that verifies it is allowed for blocks.
    $cases['VALID: period separated'] = [
        'period.separated',
        TRUE,
    ];
    return $cases;
}

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