// Verify that appropriate module API hooks have been invoked.
$this->assertTrue(isset($GLOBALS['hook_config_test']['load'])); $this->assertFalse(isset($GLOBALS['hook_config_test']['presave'])); $this->assertFalse(isset($GLOBALS['hook_config_test']['insert'])); $this->assertFalse(isset($GLOBALS['hook_config_test']['update'])); $this->assertTrue(isset($GLOBALS['hook_config_test']['predelete'])); $this->assertTrue(isset($GLOBALS['hook_config_test']['delete']));
/**
* Tests creation of configuration during import.
*/ publicfunctiontestNew(){ $dynamic_name = 'config_test.dynamic.new'; $storage = $this->container->get('config.storage'); $sync = $this->container->get('config.storage.sync');
// will be recreated.
$creates = $this->configImporter->getUnprocessedConfiguration('create'); $deletes = $this->configImporter->getUnprocessedConfiguration('delete'); $this->assertCount(5, $creates, 'There are 5 configuration items to create.'); $this->assertCount(5, $deletes, 'There are 5 configuration items to delete.'); $this->assertCount(0, $this->configImporter->getUnprocessedConfiguration('update'), 'There are no configuration items to update.'); $this->assertSame($creates, array_reverse($deletes), 'Deletes and creates contain the same configuration names in opposite orders due to dependencies.');
// Verify that there is nothing more to import.
$this->assertFalse($this->configImporter->reset()->hasUnprocessedConfigurationChanges()); $content_type = NodeType::load($type_name); $this->assertEquals('Node type one', $content_type->label()); }