Issue #2897009 follow-up by Lendude: Remove stray code accidentally included in patch.

8.5.x
webchick 2017-08-28 16:05:37 -07:00
parent e5493741a7
commit c8daa8d202
2 changed files with 3 additions and 8 deletions

View File

@ -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;
}

View File

@ -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')));