diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php index d88894d..1a667fa 100644 --- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php @@ -146,6 +146,16 @@ public function testViewsBlockForm() { $this->drupalGet('admin/structure/block/add/views_block:test_view_block-block_1/' . $default_theme); $elements = $this->xpath('//input[@name="label"]'); $this->assertTrue(empty($elements), 'The label field is not found for Views blocks.'); + // Test that that machine name field is hidden from display and has been + // saved as expected from the default value. + $this->assertNoFieldById('edit-machine-name', 'stark.views_block__test_view_block_1', 'The machine name is hidden on the views block form.'); + // Save the block. + $this->drupalPost(NULL, array(), t('Save block')); + $storage = \Drupal::entityManager()->getStorageController('block'); + $blocks = $storage->load(array('stark.views_block__test_view_block_block_1')); + // This will only return a result if our new block has been created with the + // expected machine name. + $this->assertTrue(!empty($blocks), 'The expected block was loaded.'); } /**