function LayoutSectionStorageParamConverterTest::testConvertNoType

Same name and namespace in other branches
  1. 10 core/modules/layout_builder/tests/src/Unit/LayoutSectionStorageParamConverterTest.php \Drupal\Tests\layout_builder\Unit\LayoutSectionStorageParamConverterTest::testConvertNoType()
  2. 11.x core/modules/layout_builder/tests/src/Unit/LayoutSectionStorageParamConverterTest.php \Drupal\Tests\layout_builder\Unit\LayoutSectionStorageParamConverterTest::testConvertNoType()

@covers ::convert

File

core/modules/layout_builder/tests/src/Unit/LayoutSectionStorageParamConverterTest.php, line 43

Class

LayoutSectionStorageParamConverterTest
@coversDefaultClass \Drupal\layout_builder\Routing\LayoutSectionStorageParamConverter[[api-linebreak]]

Namespace

Drupal\Tests\layout_builder\Unit

Code

public function testConvertNoType() {
  $section_storage_manager = $this->prophesize(SectionStorageManagerInterface::class);
  $converter = new LayoutSectionStorageParamConverter($section_storage_manager->reveal());
  $value = 'some_value';
  $definition = [
    'layout_builder_tempstore' => TRUE,
  ];
  $name = 'the_parameter_name';
  $defaults = [
    'section_storage_type' => NULL,
  ];
  $section_storage_manager->hasDefinition()
    ->shouldNotBeCalled();
  $section_storage_manager->load()
    ->shouldNotBeCalled();
  $result = $converter->convert($value, $definition, $name, $defaults);
  $this->assertNull($result);
}

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