public function DefaultConfigurationTest::testDefaultConfigurationValues in Allow a content type only once (Only One) 8
Tests the default configuration values.
File
- tests/
src/ Kernel/ DefaultConfigurationTest.php, line 24
Class
- DefaultConfigurationTest
- Test the module configurations.
Namespace
Drupal\Tests\onlyone\KernelCode
public function testDefaultConfigurationValues() {
// Installing the configuration file.
$this
->installConfig(self::$modules);
// Getting the config file.
$config_file = $this->container
->get('config.factory')
->get('onlyone.settings');
// Checking if the onlyone_node_types variable is empty.
$this
->assertEmpty($config_file
->get('onlyone_node_types'), 'The default configuration value for onlyone_node_types should be empty.');
// Checking if the onlyone_new_menu_entry variable is FALSE.
$this
->assertFalse($config_file
->get('onlyone_new_menu_entry'), 'The default configuration value for onlyone_new_menu_entry should be FALSE.');
// Checking if the onlyone_redirect variable is TRUE.
$this
->assertTrue($config_file
->get('onlyone_redirect'), 'The default configuration value for onlyone_new_menu_entry should be TRUE.');
}