/**
* Tests that modules can know whether bundles are translatable.
*/ publicfunctiontestHookInvocationOrder(){ $this->contentTranslationManager->setEnabled('entity_test_mul', 'entity_test_mul', TRUE); $this->bundleInfo->clearCachedBundles(); $this->bundleInfo->getAllBundleInfo();
// Verify that the test module comes first in the module list, which would
// normally make its hook implementation to be invoked first.
/** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */ $module_handler = $this->container->get('module_handler'); $module_list = $module_handler->getModuleList(); $expected_modules = [ 'content_translation_test', 'content_translation', ]; $actual_modules = array_keys(array_intersect_key($module_list, array_flip($expected_modules)));
// Ensure after a workflow is created, the bundle information can be
// refreshed.
$entity_bundle_info->clearCachedBundles(); $this->assertNotEmpty($entity_bundle_info->getAllBundleInfo());
$this->clickLink('Add a new state'); $this->submitForm([ 'label' => 'Test State', 'id' => 'test_state', 'type_settings[published]' => TRUE, 'type_settings[default_revision]' => FALSE, ], 'Save'); $session->pageTextContains('Created Test State state.'); $session->linkByHrefExists('/admin/config/workflow/workflows/manage/test/state/test_state/delete');
// Check whether we have any custom setting.
foreach($bundles[$entity_type_id]as$bundle => $bundle_info){ $config = ContentLanguageSettings::loadByEntityTypeBundle($entity_type_id, $bundle);