Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
facets
Commits
95db5d9b
Commit
95db5d9b
authored
Dec 29, 2015
by
Joris Vercammen
Browse files
Fix tests
parent
1e0c23da
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Tests/IntegrationTest.php
View file @
95db5d9b
...
...
@@ -63,9 +63,6 @@ class IntegrationTest extends FacetWebTestBase {
$facet_name
=
"Test Facet name"
;
$facet_id
=
'test_facet_name'
;
// Make sure we're logged in with a user that has sufficient permissions.
$this
->
drupalLogin
(
$this
->
adminUser
);
// Check if the overview is empty.
$this
->
checkEmptyOverview
();
...
...
@@ -172,10 +169,10 @@ class IntegrationTest extends FacetWebTestBase {
'name'
=>
$facet_name
,
'id'
=>
$facet_id
,
'status'
=>
1
,
'facet_source_id'
=>
'search_api_views:search_api_test_view
s_fulltext
:page_1'
,
'facet_source_configs[search_api_views:search_api_test_view
s_fulltext
:page_1][field_identifier]'
=>
'type'
,
'facet_source_id'
=>
'search_api_views:search_api_test_view:page_1'
,
'facet_source_configs[search_api_views:search_api_test_view:page_1][field_identifier]'
=>
'type'
,
];
$this
->
drupalPostForm
(
NULL
,
[
'facet_source_id'
=>
'search_api_views:search_api_test_view
s_fulltext
:page_1'
],
$this
->
t
(
'Configure facet source'
));
$this
->
drupalPostForm
(
NULL
,
[
'facet_source_id'
=>
'search_api_views:search_api_test_view:page_1'
],
$this
->
t
(
'Configure facet source'
));
$this
->
drupalPostForm
(
NULL
,
$form_values
,
$this
->
t
(
'Save'
));
$this
->
assertText
(
$this
->
t
(
'The name of the facet for usage in URLs field is required.'
));
...
...
@@ -343,7 +340,7 @@ class IntegrationTest extends FacetWebTestBase {
// Configure the facet source by selecting one of the search api views.
$this
->
drupalGet
(
$facet_add_page
);
$this
->
drupalPostForm
(
NULL
,
[
'facet_source_id'
=>
'search_api_views:search_api_test_view
s_fulltext
:page_1'
],
$this
->
t
(
'Configure facet source'
));
$this
->
drupalPostForm
(
NULL
,
[
'facet_source_id'
=>
'search_api_views:search_api_test_view:page_1'
],
$this
->
t
(
'Configure facet source'
));
// The facet field is still required.
$this
->
drupalPostForm
(
NULL
,
$form_values
,
$this
->
t
(
'Save'
));
...
...
@@ -352,8 +349,8 @@ class IntegrationTest extends FacetWebTestBase {
// Fill in all fields and make sure the 'field is required' message is no
// longer shown.
$facet_source_form
=
[
'facet_source_id'
=>
'search_api_views:search_api_test_view
s_fulltext
:page_1'
,
'facet_source_configs[search_api_views:search_api_test_view
s_fulltext
:page_1][field_identifier]'
=>
'type'
,
'facet_source_id'
=>
'search_api_views:search_api_test_view:page_1'
,
'facet_source_configs[search_api_views:search_api_test_view:page_1][field_identifier]'
=>
'type'
,
];
$this
->
drupalPostForm
(
NULL
,
$form_values
+
$facet_source_form
,
$this
->
t
(
'Save'
));
$this
->
assertNoText
(
'field is required.'
);
...
...
@@ -363,7 +360,6 @@ class IntegrationTest extends FacetWebTestBase {
$this
->
assertUrl
(
'admin/config/search/facets/'
.
$facet_id
.
'/display'
);
$this
->
drupalGet
(
'admin/config/search/facets'
);
$this
->
assertText
(
$facet_name
,
'Facet correctly shows up on the overview page.'
);
}
...
...
src/Tests/UrlIntegrationTest.php
View file @
95db5d9b
...
...
@@ -59,10 +59,10 @@ class UrlIntegrationTest extends FacetWebTestBase {
'status'
=>
1
,
'url_alias'
=>
$id
,
'name'
=>
$name
,
'facet_source_id'
=>
'search_api_views:search_api_test_view
s_fulltext
:page_1'
,
'facet_source_configs[search_api_views:search_api_test_view
s_fulltext
:page_1][field_identifier]'
=>
'type'
,
'facet_source_id'
=>
'search_api_views:search_api_test_view:page_1'
,
'facet_source_configs[search_api_views:search_api_test_view:page_1][field_identifier]'
=>
'type'
,
];
$this
->
drupalPostForm
(
NULL
,
[
'facet_source_id'
=>
'search_api_views:search_api_test_view
s_fulltext
:page_1'
],
$this
->
t
(
'Configure facet source'
));
$this
->
drupalPostForm
(
NULL
,
[
'facet_source_id'
=>
'search_api_views:search_api_test_view:page_1'
],
$this
->
t
(
'Configure facet source'
));
$this
->
drupalPostForm
(
NULL
,
$form_values
,
$this
->
t
(
'Save'
));
// Go to the only enabled facet source's config.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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