diff --git a/core/modules/views/src/Tests/Plugin/DisplayTest.php b/core/modules/views/src/Tests/Plugin/DisplayTest.php index b6092bc..afa30b3 100644 --- a/core/modules/views/src/Tests/Plugin/DisplayTest.php +++ b/core/modules/views/src/Tests/Plugin/DisplayTest.php @@ -233,12 +233,25 @@ public function testReadMore() { */ public function testReadMoreNoDisplay() { $view = Views::getView('test_display_more'); + // Test that no errors exist if there is a page display with path. + $errors = $view->validate(); + $this->assertTrue(empty($errors), 'More link validation has no errors.'); + + // Test that errors exist with the page display disabled. $view->setDisplay('page_1'); $view->display_handler->setOption('enabled', FALSE); $view->setDisplay('default'); $errors = $view->validate(); $this->assertTrue(!empty($errors), 'More link validation has some errors.'); $this->assertEqual($errors['default'][0], 'Display "Master" uses a "more" link but there are no displays it can link to. Please specify a custom URL.', 'More link validation has the right error.'); + + // Test that errors exist with no page display. + $view = Views::getView('test_view'); + $view->setDisplay('default'); + $view->display_handler->setOption('use_more', 1); + $errors = $view->validate(); + $this->assertTrue(!empty($errors), 'More link validation has some errors.'); + $this->assertEqual($errors['default'][0], 'Display "Master" uses a "more" link but there are no displays it can link to. Please specify a custom URL.', 'More link validation has the right error.'); } /**