FeaturesAssignerTest.php in Features 8.4
File
tests/src/Kernel/FeaturesAssignerTest.php
View source
<?php
namespace Drupal\Tests\features\Kernel;
use Drupal\KernelTests\KernelTestBase;
class FeaturesAssignerTest extends KernelTestBase {
public static $modules = [
'system',
'config',
];
protected $strictConfigSchema = FALSE;
protected function setUp() {
parent::setUp();
$this
->installConfig('system');
}
public function testBundleAutoCreationImport() {
$installer = $this->container
->get('module_installer');
$installer
->install([
'features',
]);
$installer
->install([
'test_feature',
]);
$this
->copyConfig($this->container
->get('config.storage'), $this->container
->get('config.storage.sync'));
$installer
->uninstall([
'features',
'test_feature',
]);
$this
->configImporter()
->import();
$bundle_storage = $this->container
->get('entity_type.manager')
->getStorage('features_bundle');
$bundle = $bundle_storage
->load('test');
$this
->assertNotNull($bundle, "Features bundle doesn't exist");
$this
->assertStringContainsString('Auto-generated bundle', $bundle
->getDescription(), "Features bundle not auto-created");
}
}