$this->assertNotEmpty($this->blockStorage->load($default_block_id)); $this->assertNotEmpty($usage->getUsage($default_block_id)); // Remove block from default.
$this->removeInlineBlockFromLayout(); $this->assertSaveLayout(); // Ensure the block in the default was deleted.
$this->blockStorage->resetCache([$default_block_id]); $this->assertEmpty($this->blockStorage->load($default_block_id)); // Ensure other blocks still exist.
$this->assertCount(2, $this->blockStorage->loadMultiple()); $this->assertEmpty($usage->getUsage($default_block_id));
// Remove the inline block with the private file.
$this->drupalGet('node/1/layout'); $this->removeInlineBlockFromLayout(); $this->assertSaveLayout();
$this->drupalGet('node/1'); $assert_session->pageTextNotContains($file->label()); // Try to access file directly after it has been removed. Since a new
// revision was not created for the node the inline block is not in the
// layout of a previous revision of the node.
$this->drupalGet($private_href1); $assert_session->pageTextContains('You are not authorized to access this page'); $assert_session->pageTextNotContains($this->getFileSecret($file)); $this->assertFileExists($file_real_path);