Commit 3773e7a5 authored by borisson_'s avatar borisson_ Committed by borisson_

Issue #2862999 by borisson_, ekes: Core date facet

parent 33f383d5
......@@ -193,7 +193,7 @@ class CoreNodeSearchFacetSource extends FacetSourcePluginBase implements CoreSea
case 'created':
case 'changed':
$query_types['string'] = 'core_node_search_date';
$query_types['date'] = 'core_node_search_date';
break;
}
......
......@@ -10,7 +10,7 @@ use Drupal\field\Entity\FieldStorageConfig;
*
* @group facets
*/
class TestCoreSearchBase extends CoreSearchFacetsTestBase {
class HooksTest extends CoreSearchFacetsTestBase {
/**
* {@inheritdoc}
......
......@@ -10,7 +10,7 @@ use Drupal\node\Entity\Node;
*
* @group facets
*/
class IntegrationTestCoreSearchBase extends CoreSearchFacetsTestBase {
class IntegrationTest extends CoreSearchFacetsTestBase {
use BlockTestTrait;
......@@ -107,6 +107,9 @@ class IntegrationTestCoreSearchBase extends CoreSearchFacetsTestBase {
$this->blocks[$facet_id] = $this->createBlock($facet_id);
$this->setShowAmountOfResults($facet_id, TRUE);
$this->drupalGet("admin/config/search/facets/$facet_id/edit");
$this->drupalPostForm(NULL, ['widget' => 'datebasic'], 'Save');
// Assert date facets.
$this->drupalGet('search/node', ['query' => ['keys' => 'test']]);
$this->assertFacetLabel('February 2016 (9)');
......@@ -143,6 +146,9 @@ class IntegrationTestCoreSearchBase extends CoreSearchFacetsTestBase {
$this->blocks[$facet_id] = $this->createBlock($facet_id);
$this->setShowAmountOfResults($facet_id, TRUE);
$this->drupalGet("admin/config/search/facets/$facet_id/edit");
$this->drupalPostForm(NULL, ['widget' => 'datebasic'], 'Save');
// Update the changed date. The nodes were created on February/March 2016
// and the changed date is June 3, 2016.
$node = Node::load(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment