DefaultConfigurationTest.php in Allow a content type only once (Only One) 8
File
tests/src/Kernel/DefaultConfigurationTest.php
View source
<?php
namespace Drupal\Tests\onlyone\Kernel;
use Drupal\KernelTests\KernelTestBase;
class DefaultConfigurationTest extends KernelTestBase {
protected static $modules = [
'onlyone',
];
public function testDefaultConfigurationValues() {
$this
->installConfig(self::$modules);
$config_file = $this->container
->get('config.factory')
->get('onlyone.settings');
$this
->assertEmpty($config_file
->get('onlyone_node_types'), 'The default configuration value for onlyone_node_types should be empty.');
$this
->assertFalse($config_file
->get('onlyone_new_menu_entry'), 'The default configuration value for onlyone_new_menu_entry should be FALSE.');
$this
->assertTrue($config_file
->get('onlyone_redirect'), 'The default configuration value for onlyone_new_menu_entry should be TRUE.');
}
}