Commit 6708fa6c authored by borisson_'s avatar borisson_ Committed by borisson_

Issue #2995806 by borisson_, waluigi: Automatically order facet parameters in...

Issue #2995806 by borisson_, waluigi: Automatically order facet parameters in query string to reduce cache permutations
parent 085791b5
...@@ -228,7 +228,7 @@ class RestIntegrationTest extends FacetsTestBase { ...@@ -228,7 +228,7 @@ class RestIntegrationTest extends FacetsTestBase {
$base_url, $base_url,
'/facets-rest', '/facets-rest',
'_format=json', '_format=json',
'f%5B0%5D=type%3Aitem&f%5B1%5D=type%3Aarticle', 'f%5B0%5D=type%3Aarticle&f%5B1%5D=type%3Aitem',
], ],
'count' => 2, 'count' => 2,
], ],
...@@ -241,7 +241,7 @@ class RestIntegrationTest extends FacetsTestBase { ...@@ -241,7 +241,7 @@ class RestIntegrationTest extends FacetsTestBase {
$base_url, $base_url,
'/facets-rest', '/facets-rest',
'_format=json', '_format=json',
'f%5B0%5D=type%3Aitem&f%5B1%5D=keywords%3Abanana', 'f%5B0%5D=keywords%3Abanana&f%5B1%5D=type%3Aitem',
], ],
'count' => 0, 'count' => 0,
], ],
...@@ -250,7 +250,7 @@ class RestIntegrationTest extends FacetsTestBase { ...@@ -250,7 +250,7 @@ class RestIntegrationTest extends FacetsTestBase {
$base_url, $base_url,
'/facets-rest', '/facets-rest',
'_format=json', '_format=json',
'f%5B0%5D=type%3Aitem&f%5B1%5D=keywords%3Astrawberry', 'f%5B0%5D=keywords%3Astrawberry&f%5B1%5D=type%3Aitem',
], ],
'count' => 0, 'count' => 0,
], ],
...@@ -259,7 +259,7 @@ class RestIntegrationTest extends FacetsTestBase { ...@@ -259,7 +259,7 @@ class RestIntegrationTest extends FacetsTestBase {
$base_url, $base_url,
'/facets-rest', '/facets-rest',
'_format=json', '_format=json',
'f%5B0%5D=type%3Aitem&f%5B1%5D=keywords%3Aapple', 'f%5B0%5D=keywords%3Aapple&f%5B1%5D=type%3Aitem',
], ],
'count' => 1, 'count' => 1,
], ],
...@@ -268,7 +268,7 @@ class RestIntegrationTest extends FacetsTestBase { ...@@ -268,7 +268,7 @@ class RestIntegrationTest extends FacetsTestBase {
$base_url, $base_url,
'/facets-rest', '/facets-rest',
'_format=json', '_format=json',
'f%5B0%5D=type%3Aitem&f%5B1%5D=keywords%3Aorange', 'f%5B0%5D=keywords%3Aorange&f%5B1%5D=type%3Aitem',
], ],
'count' => 2, 'count' => 2,
], ],
...@@ -277,7 +277,7 @@ class RestIntegrationTest extends FacetsTestBase { ...@@ -277,7 +277,7 @@ class RestIntegrationTest extends FacetsTestBase {
$base_url, $base_url,
'/facets-rest', '/facets-rest',
'_format=json', '_format=json',
'f%5B0%5D=type%3Aitem&f%5B1%5D=keywords%3Agrape', 'f%5B0%5D=keywords%3Agrape&f%5B1%5D=type%3Aitem',
], ],
'count' => 1, 'count' => 1,
], ],
...@@ -287,7 +287,7 @@ class RestIntegrationTest extends FacetsTestBase { ...@@ -287,7 +287,7 @@ class RestIntegrationTest extends FacetsTestBase {
$value = $result->values->value; $value = $result->values->value;
$this->assertEquals($results[$value]['count'], $result->values->count); $this->assertEquals($results[$value]['count'], $result->values->count);
foreach ($results[$value]['url'] as $url_part) { foreach ($results[$value]['url'] as $url_part) {
$this->assertNotFalse(strpos($result->url, $url_part)); $this->assertContains($url_part, $result->url);
} }
} }
...@@ -295,7 +295,7 @@ class RestIntegrationTest extends FacetsTestBase { ...@@ -295,7 +295,7 @@ class RestIntegrationTest extends FacetsTestBase {
$value = $result->values->value; $value = $result->values->value;
$this->assertEquals($results[$value]['count'], $result->values->count); $this->assertEquals($results[$value]['count'], $result->values->count);
foreach ($results[$value]['url'] as $url_part) { foreach ($results[$value]['url'] as $url_part) {
$this->assertNotFalse(strpos($result->url, $url_part)); $this->assertContains($url_part, $result->url);
} }
} }
} }
......
...@@ -149,7 +149,7 @@ class QueryString extends UrlProcessorPluginBase { ...@@ -149,7 +149,7 @@ class QueryString extends UrlProcessorPluginBase {
} }
} }
} }
asort($filter_params, \SORT_NATURAL);
$result_get_params->set($this->filterKey, array_values($filter_params)); $result_get_params->set($this->filterKey, array_values($filter_params));
if (!empty($routeParameters)) { if (!empty($routeParameters)) {
$url->setRouteParameters($routeParameters); $url->setRouteParameters($routeParameters);
......
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