summaryrefslogtreecommitdiffstats
path: root/core/modules/views_ui
diff options
context:
space:
mode:
authorNathaniel Catchpole2017-09-11 12:47:25 (GMT)
committerNathaniel Catchpole2017-09-11 12:47:25 (GMT)
commit0fa72bdeea3d72e874b25dc72d2185645b57d6c5 (patch)
tree11998cffc41e4bd2f6b72dad16f118f06a141a77 /core/modules/views_ui
parente630c782add6ab68d91d5c47cf72d29ecb7949db (diff)
Issue #2853359 by vaplas, Lendude, tinny: Runtime debug statement in Views now prints out object
Diffstat (limited to 'core/modules/views_ui')
-rw-r--r--core/modules/views_ui/src/Tests/ViewEditTest.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/core/modules/views_ui/src/Tests/ViewEditTest.php b/core/modules/views_ui/src/Tests/ViewEditTest.php
index 819a439..a939f97 100644
--- a/core/modules/views_ui/src/Tests/ViewEditTest.php
+++ b/core/modules/views_ui/src/Tests/ViewEditTest.php
@@ -75,8 +75,13 @@ class ViewEditTest extends UITestBase {
$error_text = t('Display name must be letters, numbers, or underscores only.');
// Test that potential invalid display ID requests are detected
- $this->drupalGet('admin/structure/views/ajax/handler/test_view/fake_display_name/filter/title');
- $this->assertText('Invalid display id fake_display_name');
+ try {
+ $this->drupalGet('admin/structure/views/ajax/handler/test_view/fake_display_name/filter/title');
+ $this->fail('Expected error, when setDisplay() called with invalid display ID');
+ }
+ catch (\Exception $e) {
+ $this->assertEqual('setDisplay() called with invalid display ID "fake_display_name".', $e->getMessage());
+ }
$edit = ['display_id' => 'test 1'];
$this->drupalPostForm($machine_name_edit_url, $edit, 'Apply');
@@ -239,4 +244,16 @@ class ViewEditTest extends UITestBase {
$this->drupalPostForm('admin/structure/views/nojs/handler/test_groupwise_term_ui/default/relationship/tid_representative', $edit, 'Apply');
}
+ /**
+ * Override the error method so we can test for the expected exception.
+ *
+ * @todo Remove as part of https://www.drupal.org/node/2864613
+ */
+ protected function error($message = '', $group = 'Other', array $caller = NULL) {
+ if ($group === 'User warning') {
+ throw new \Exception($message);
+ }
+ return parent::error($message, $group, $caller);
+ }
+
}