diff --git a/core/modules/views/src/Plugin/views/filter/NumericFilter.php b/core/modules/views/src/Plugin/views/filter/NumericFilter.php index af3047205b5b49cc9181e2a16262e9302bec7b35..b0b700c2f63faf6456c8f6b0d410a8998fd6f20f 100644 --- a/core/modules/views/src/Plugin/views/filter/NumericFilter.php +++ b/core/modules/views/src/Plugin/views/filter/NumericFilter.php @@ -87,7 +87,7 @@ function operators() { 'regular_expression' => array( 'title' => $this->t('Regular expression'), 'short' => $this->t('regex'), - 'method' => 'op_regex', + 'method' => 'opRegex', 'values' => 1, ), ); diff --git a/core/modules/views_ui/src/Tests/FilterNumericWebTest.php b/core/modules/views_ui/src/Tests/FilterNumericWebTest.php index f89199579acb9ca5d0ea40458ada9a2b7934cebb..0199cede589776ff853489792879d25eac903ab6 100644 --- a/core/modules/views_ui/src/Tests/FilterNumericWebTest.php +++ b/core/modules/views_ui/src/Tests/FilterNumericWebTest.php @@ -112,6 +112,23 @@ public function testFilterNumericUI() { $this->assertRaw('<label for="edit-age-min">Age between</label>', 'Min field label found'); // Check that the description is shown in the right place. $this->assertEqual(trim($this->cssSelect('.form-item-age-min .description')[0]), 'Description of the exposed filter'); + // Check if the filter 'regular expression' is working properly. + $this->drupalGet('admin/structure/views/nojs/handler/test_view/default/filter/age'); + $edit = array(); + $edit['options[expose][label]'] = 'Age expression'; + $edit['options[expose][description]'] = 'Description of the exposed filter'; + $edit['options[operator]'] = 'regular_expression'; + $edit['options[value][value]'] = '26|27'; + $this->drupalPostForm(NULL, $edit, t('Apply')); + $this->drupalPostForm('admin/structure/views/view/test_view', array(), t('Save')); + $this->assertConfigSchemaByName('views.view.test_view'); + + $this->drupalPostForm(NULL, array(), t('Update preview')); + $this->assertNoText('John'); + $this->assertText('Paul'); + $this->assertNoText('Ringo'); + $this->assertText('George'); + $this->assertNoText('Meredith'); } }