function SectionStorageManagerTest::testLoadNull

Same name in other branches
  1. 8.9.x core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php \Drupal\Tests\layout_builder\Unit\SectionStorageManagerTest::testLoadNull()
  2. 10 core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php \Drupal\Tests\layout_builder\Unit\SectionStorageManagerTest::testLoadNull()
  3. 11.x core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php \Drupal\Tests\layout_builder\Unit\SectionStorageManagerTest::testLoadNull()

@covers ::load

File

core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php, line 113

Class

SectionStorageManagerTest
@coversDefaultClass \Drupal\layout_builder\SectionStorage\SectionStorageManager

Namespace

Drupal\Tests\layout_builder\Unit

Code

public function testLoadNull() {
    $contexts = [
        'the_context' => $this->prophesize(ContextInterface::class)
            ->reveal(),
    ];
    $this->contextHandler
        ->applyContextMapping($this->plugin, $contexts)
        ->willThrow(new ContextException());
    $result = $this->manager
        ->load('the_plugin_id', $contexts);
    $this->assertNull($result);
}

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