new Section('layout_onecol'
),
];
$this->
assertCount(1,
$sections);
$section_storage->
getSections()->
willReturn($sections);
$section_storage->
count()->
willReturn(1
);
$section_storage_manager->
findByContext(Argument::
cetera())->
willReturn($section_storage->
reveal());
$this->container->
set('plugin.manager.layout_builder.section_storage',
$section_storage_manager->
reveal());
$class =
new TestLayoutEntityHelperTrait();
// Ensure that if the entity has a section storage the sections will be
// returned.
$this->
assertSame($sections,
$class->
getEntitySections($entity));
$section_storage_manager->
findByContext(Argument::
cetera())->
willReturn(NULL
);
$this->container->
set('plugin.manager.layout_builder.section_storage',
$section_storage_manager->
reveal());
// Ensure that if the entity has no section storage an empty array will be
// returned.
$this->
assertSame([],
$class->
getEntitySections($entity));
}}/**
* Test class using the trait.
*/