Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
facets
Commits
3773e7a5
Commit
3773e7a5
authored
Aug 12, 2017
by
borisson_
Committed by
borisson_
Aug 12, 2017
Browse files
Issue
#2862999
by borisson_, ekes: Core date facet
parent
33f383d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
modules/core_search_facets/src/Plugin/facets/facet_source/CoreNodeSearchFacetSource.php
View file @
3773e7a5
...
...
@@ -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
;
}
...
...
modules/core_search_facets/tests/src/Functional/HooksTest.php
View file @
3773e7a5
...
...
@@ -10,7 +10,7 @@ use Drupal\field\Entity\FieldStorageConfig;
*
* @group facets
*/
class
TestCoreSearchBase
extends
CoreSearchFacetsTestBase
{
class
HooksTest
extends
CoreSearchFacetsTestBase
{
/**
* {@inheritdoc}
...
...
modules/core_search_facets/tests/src/Functional/IntegrationTest.php
View file @
3773e7a5
...
...
@@ -10,7 +10,7 @@ use Drupal\node\Entity\Node;
*
* @group facets
*/
class
IntegrationTest
CoreSearchBase
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment