You are here

protected function InlineBlockTestBase::getLatestBlockEntityId in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTestBase::getLatestBlockEntityId()
  2. 9 core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTestBase::getLatestBlockEntityId()

Gets the latest block entity id.

File

core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php, line 99

Class

InlineBlockTestBase
Base class for testing inline blocks.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function getLatestBlockEntityId() {
  $block_ids = \Drupal::entityQuery('block_content')
    ->accessCheck(FALSE)
    ->sort('id', 'DESC')
    ->range(0, 1)
    ->execute();
  $block_id = array_pop($block_ids);
  $this
    ->assertNotEmpty($this->blockStorage
    ->load($block_id));
  return $block_id;
}