function LayoutSectionStorageParamConverterTest::testConvertInvalidConverter
Same name in other branches
- 9 core/modules/layout_builder/tests/src/Unit/LayoutSectionStorageParamConverterTest.php \Drupal\Tests\layout_builder\Unit\LayoutSectionStorageParamConverterTest::testConvertInvalidConverter()
- 11.x core/modules/layout_builder/tests/src/Unit/LayoutSectionStorageParamConverterTest.php \Drupal\Tests\layout_builder\Unit\LayoutSectionStorageParamConverterTest::testConvertInvalidConverter()
@covers ::convert
File
-
core/
modules/ layout_builder/ tests/ src/ Unit/ LayoutSectionStorageParamConverterTest.php, line 64
Class
- LayoutSectionStorageParamConverterTest
- @coversDefaultClass \Drupal\layout_builder\Routing\LayoutSectionStorageParamConverter
Namespace
Drupal\Tests\layout_builder\UnitCode
public function testConvertInvalidConverter() : void {
$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' => 'invalid',
];
$section_storage_manager->hasDefinition('invalid')
->willReturn(FALSE);
$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.