public function ConfigEntityTypeTest::testConfigPrefixLengthExceeds in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityTypeTest::testConfigPrefixLengthExceeds()
Tests that we get an exception when the length of the config prefix that is returned by getConfigPrefix() exceeds the maximum defined prefix length.
@covers ::getConfigPrefix
File
- core/
tests/ Drupal/ Tests/ Core/ Config/ Entity/ ConfigEntityTypeTest.php, line 42 - Contains \Drupal\Tests\Core\Config\Entity\ConfigEntityTypeTest.
Class
- ConfigEntityTypeTest
- @coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityType @group Config
Namespace
Drupal\Tests\Core\Config\EntityCode
public function testConfigPrefixLengthExceeds() {
// A provider length of 24 and config_prefix length of 59 (+1 for the .)
// results in a config length of 84, which is too long.
$definition = array(
'provider' => $this
->randomMachineName(24),
'config_prefix' => $this
->randomMachineName(59),
);
$config_entity = $this
->setUpConfigEntityType($definition);
$this
->setExpectedException('\\Drupal\\Core\\Config\\ConfigPrefixLengthException', "The configuration file name prefix {$definition['provider']}.{$definition['config_prefix']} exceeds the maximum character limit of " . ConfigEntityType::PREFIX_LENGTH);
$this
->assertEmpty($config_entity
->getConfigPrefix());
}