Chris@0: getModuleName() calls system_get_info(). Chris@0: 'system', Chris@0: 'taxonomy', Chris@0: 'user', Chris@0: 'text', Chris@0: ]; Chris@0: Chris@0: /** Chris@0: * The typed config manager. Chris@0: * Chris@0: * @var \Drupal\Core\Config\TypedConfigManagerInterface Chris@0: */ Chris@0: protected $typedConfig; Chris@0: Chris@0: /** Chris@0: * The block manager. Chris@0: * Chris@0: * @var \Drupal\Core\Block\BlockManagerInterface Chris@0: */ Chris@0: protected $blockManager; Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: protected function setUp() { Chris@0: parent::setUp(); Chris@0: Chris@0: $this->typedConfig = \Drupal::service('config.typed'); Chris@0: $this->blockManager = \Drupal::service('plugin.manager.block'); Chris@0: $this->installEntitySchema('block_content'); Chris@0: $this->installEntitySchema('taxonomy_term'); Chris@0: $this->installEntitySchema('node'); Chris@0: $this->installSchema('book', ['book']); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Tests the block config schema for block plugins. Chris@0: */ Chris@0: public function testBlockConfigSchema() { Chris@0: foreach ($this->blockManager->getDefinitions() as $block_id => $definition) { Chris@0: $id = strtolower($this->randomMachineName()); Chris@0: $block = Block::create([ Chris@0: 'id' => $id, Chris@0: 'theme' => 'classy', Chris@0: 'weight' => 00, Chris@0: 'status' => TRUE, Chris@0: 'region' => 'content', Chris@0: 'plugin' => $block_id, Chris@0: 'settings' => [ Chris@0: 'label' => $this->randomMachineName(), Chris@0: 'provider' => 'system', Chris@0: 'label_display' => FALSE, Chris@0: ], Chris@0: 'visibility' => [], Chris@0: ]); Chris@0: $block->save(); Chris@0: Chris@0: $config = $this->config("block.block.$id"); Chris@0: $this->assertEqual($config->get('id'), $id); Chris@0: $this->assertConfigSchema($this->typedConfig, $config->getName(), $config->get()); Chris@0: } Chris@0: } Chris@0: Chris@0: }