X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fblock_content%2Ftests%2Fsrc%2FFunctional%2FViews%2FBlockContentWizardTest.php;fp=web%2Fcore%2Fmodules%2Fblock_content%2Ftests%2Fsrc%2FFunctional%2FViews%2FBlockContentWizardTest.php;h=2c59e5c50fe84ec0c7888e02f0d84e0a7d273821;hp=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php b/web/core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php new file mode 100644 index 000000000..2c59e5c50 --- /dev/null +++ b/web/core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php @@ -0,0 +1,52 @@ +drupalLogin($this->drupalCreateUser(['administer views'])); + $this->createBlockContentType('Basic block'); + } + + /** + * Tests creating a 'block_content' entity view. + */ + public function testViewAddBlockContent() { + $view = []; + $view['label'] = $this->randomMachineName(16); + $view['id'] = strtolower($this->randomMachineName(16)); + $view['description'] = $this->randomMachineName(16); + $view['page[create]'] = FALSE; + $view['show[wizard_key]'] = 'block_content'; + $this->drupalPostForm('admin/structure/views/add', $view, t('Save and edit')); + + $view_storage_controller = $this->container->get('entity_type.manager')->getStorage('view'); + /** @var \Drupal\views\Entity\View $view */ + $view = $view_storage_controller->load($view['id']); + + $display_options = $view->getDisplay('default')['display_options']; + + $this->assertEquals('block_content', $display_options['filters']['reusable']['entity_type']); + $this->assertEquals('reusable', $display_options['filters']['reusable']['entity_field']); + $this->assertEquals('boolean', $display_options['filters']['reusable']['plugin_id']); + $this->assertEquals('1', $display_options['filters']['reusable']['value']); + } + +}