Skip to content

Commit

Permalink
[TASK] Query handling unit test
Browse files Browse the repository at this point in the history
Add additional unit test to verify facet values with multi value separators.

Fixes: #2257
  • Loading branch information
3l73 authored and dkd-kaehm committed Aug 18, 2021
1 parent 1ab0796 commit 552b45c
Showing 1 changed file with 5 additions and 35 deletions.
40 changes: 5 additions & 35 deletions Tests/Unit/Routing/RoutingServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,38 +109,6 @@ public function combiningFacetsUsingCustomSeparatorTest()
);
}

/**
* @test
* @covers \ApacheSolrForTypo3\Solr\Routing\RoutingService::facetStringToArray
*/
public function canExplodeStringToArrayTest()
{
$routingService = new RoutingService([]);

$this->assertEquals(
['bar', 'buz', 'foo'],
$routingService->facetStringToArray('bar,buz,foo')
);
}

/**
* @test
* @covers \ApacheSolrForTypo3\Solr\Routing\RoutingService::facetStringToArray
*/
public function canExplodeStringToArrayWithCustomSeparatorTest()
{
$routingService = new RoutingService(
[
'multiValueSeparator' => '+'
]
);

$this->assertEquals(
['bar', 'buz', 'foo'],
$routingService->facetStringToArray('bar+buz+foo')
);
}

/**
* @test
* @covers \ApacheSolrForTypo3\Solr\Routing\RoutingService::convertStringIntoUri
Expand Down Expand Up @@ -183,6 +151,7 @@ public function testDeflateFilterQueryParameterTest()
'product:sweets',
'color:green',
'taste:matcha',
'taste:sour,matcha',
'color:red',
'product:candy',
]
Expand All @@ -196,7 +165,7 @@ public function testDeflateFilterQueryParameterTest()
'tx_solr' => [
'filter' => [
'color:green,red,yellow',
'taste:matcha,sour',
'taste:matcha,sour,sour°matcha',
'product:candy,sweets'
]
]
Expand All @@ -222,7 +191,7 @@ public function testInflateFilterQueryParameterTest()
'filter' => [
'color:green,red,yellow',
'product:candy,sweets',
'taste:matcha,sour'
'taste:matcha,sour,sour°matcha'
]
]
];
Expand All @@ -239,7 +208,8 @@ public function testInflateFilterQueryParameterTest()
'product:candy',
'product:sweets',
'taste:matcha',
'taste:sour'
'taste:sour',
'taste:sour,matcha'
]
]
];
Expand Down

0 comments on commit 552b45c

Please sign in to comment.