Issue #3143096 by jedihe, phenaproxima, jyotimishra123, shetpooja04, alexpott,...
Issue #3143096 by jedihe, phenaproxima, jyotimishra123, shetpooja04, alexpott, mradcliffe, tim.plunkett: [DX]: throw an exception if #lazy_builder callback does not return a (renderable) array
// Throw an exception if #lazy_builder callback does not return an array;
// provide helpful details for troubleshooting.
assert(is_array($new_elements),"#lazy_builder callbacks must return a valid renderable array, got ".gettype($new_elements)." from ".Variable::callableToString($elements['#lazy_builder'][0]));
// Retain the original cacheability metadata, plus cache keys.
$this->expectExceptionMessage("#lazy_builder callbacks must return a valid renderable array, got boolean from \Drupal\Tests\Core\Render\PlaceholdersTest::callbackNonArrayReturn");
$this->renderer->renderRoot($element);
}
/**
* Create an element with a child and subchild. Each element has the same
* #lazy_builder callback, but with different contexts. They don't modify