diff --git a/src/Plugin/ProjectBrowserSource/MockDrupalDotOrg.php b/src/Plugin/ProjectBrowserSource/MockDrupalDotOrg.php index 699044de2098d06515ad941b3633db3bbd2a2171..c59a38b797798022c46d0c19720d641d0bbdd32c 100644 --- a/src/Plugin/ProjectBrowserSource/MockDrupalDotOrg.php +++ b/src/Plugin/ProjectBrowserSource/MockDrupalDotOrg.php @@ -424,8 +424,8 @@ class MockDrupalDotOrg extends ProjectBrowserSourceBase implements ContainerFact // Filter by search term. if (array_key_exists('search', $query)) { - $title = $query['search']; - $db_query->condition('pbp.title', "%$title%", 'LIKE'); + $search = $query['search']; + $db_query->condition('pbp.project_data', "%$search%", 'LIKE'); } $db_query->groupBy('pbp.nid'); diff --git a/tests/src/FunctionalJavascript/ProjectBrowserUiTest.php b/tests/src/FunctionalJavascript/ProjectBrowserUiTest.php index 802a32a2782c58b1fe8d6392f8a6e4804b28ba67..5ef6392623e8de91f8917236b024707612dc2010 100644 --- a/tests/src/FunctionalJavascript/ProjectBrowserUiTest.php +++ b/tests/src/FunctionalJavascript/ProjectBrowserUiTest.php @@ -559,19 +559,13 @@ class ProjectBrowserUiTest extends WebDriverTestBase { ]); $this->inputSearchField('', TRUE); - $this->inputSearchField('/'); + $this->inputSearchField('&:'); $this->assertProjectsVisible([ 'Unwritten&:/', ]); $this->inputSearchField('', TRUE); - $this->inputSearchField(':'); - $this->assertProjectsVisible([ - 'Unwritten&:/', - ]); - - $this->inputSearchField('', TRUE); - $this->inputSearchField(';'); + $this->inputSearchField('$?'); $this->assertProjectsVisible([ 'Vitamin&C;$?', ]); @@ -727,11 +721,9 @@ class ProjectBrowserUiTest extends WebDriverTestBase { $this->clickWithWait('#67', '20 Results'); // Filter by search text. - $this->inputSearchField('th'); - $this->assertTrue($assert_session->waitForText('4 Results')); + $this->inputSearchField('Number'); + $this->assertTrue($assert_session->waitForText('2 Results')); $this->assertProjectsVisible([ - 'Tooth Fairy', - 'Pinky and the Brain', '9 Starts With a Higher Number', '1 Starts With a Number', ]); @@ -757,14 +749,12 @@ class ProjectBrowserUiTest extends WebDriverTestBase { // Switch back to first tab. $this->pressWithWait('drupalorg_mockapi'); // Assert that the filters persist. - $this->assertTrue($assert_session->waitForText('4 Results')); + $this->assertTrue($assert_session->waitForText('2 Results')); $first_filter_element = $page->find('css', 'p.filter-applied:nth-child(1)'); $this->assertEquals('E-commerce', $first_filter_element->find('css', '.filter-applied__label')->getText()); $second_filter_element = $page->find('css', 'p.filter-applied:nth-child(2)'); $this->assertEquals('Media', $second_filter_element->find('css', '.filter-applied__label')->getText()); $this->assertProjectsVisible([ - 'Tooth Fairy', - 'Pinky and the Brain', '9 Starts With a Higher Number', '1 Starts With a Number', ]);