Issue #2897009 follow-up by Lendude: Remove stray code accidentally included in patch.
parent
e5493741a7
commit
c8daa8d202
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Drupal\views;
|
||||
|
||||
use Drupal\Component\Render\FormattableMarkup;
|
||||
use Drupal\Component\Utility\Html;
|
||||
use Drupal\Component\Utility\Tags;
|
||||
use Drupal\Core\Routing\RouteProviderInterface;
|
||||
|
@ -800,7 +799,7 @@ class ViewExecutable {
|
|||
|
||||
// Ensure the requested display exists.
|
||||
if (!$this->displayHandlers->has($display_id)) {
|
||||
trigger_error(new FormattableMarkup('setDisplay() called with invalid display ID "@display".', ['@display' => $display_id]));
|
||||
debug(format_string('setDisplay() called with invalid display ID "@display".', ['@display' => $display_id]));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -196,12 +196,8 @@ class ViewExecutableTest extends ViewsKernelTestBase {
|
|||
$view->initDisplay();
|
||||
|
||||
// Error is triggered while calling the wrong display.
|
||||
try {
|
||||
$view->setDisplay('invalid');
|
||||
}
|
||||
catch (\PHPUnit_Framework_Error $e) {
|
||||
$this->assertEquals('setDisplay() called with invalid display ID "invalid".', $e->getMessage());
|
||||
}
|
||||
$this->setExpectedException(\PHPUnit_Framework_Error::class);
|
||||
$view->setDisplay('invalid');
|
||||
|
||||
$this->assertEqual($view->current_display, 'default', 'If setDisplay is called with an invalid display id the default display should be used.');
|
||||
$this->assertEqual(spl_object_hash($view->display_handler), spl_object_hash($view->displayHandlers->get('default')));
|
||||
|
|
Loading…
Reference in New Issue