function InlineBlockTestBase::getLatestBlockEntityId

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTestBase::getLatestBlockEntityId()
  2. 8.9.x core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTestBase::getLatestBlockEntityId()
  3. 10 core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTestBase::getLatestBlockEntityId()

Gets the latest block entity id.

2 calls to InlineBlockTestBase::getLatestBlockEntityId()
InlineBlockTest::testAccess in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests access to the block edit form of inline blocks.
InlineBlockTest::testDeletion in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests that entity blocks deleted correctly.

File

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

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.