mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
[search] allow '-' in argument name
This commit is contained in:
parent
f56de656d3
commit
6011c720a9
@ -82,7 +82,7 @@ class SearchProvider
|
|||||||
private function extractTerms(&$subject)
|
private function extractTerms(&$subject)
|
||||||
{
|
{
|
||||||
$terms = array();
|
$terms = array();
|
||||||
preg_match_all('/([a-z]+):([\w\-]+|\([^\(\r\n]+\))/', $subject, $matches);
|
preg_match_all('/([a-z\-]+):([\w\-]+|\([^\(\r\n]+\))/', $subject, $matches);
|
||||||
|
|
||||||
foreach ($matches[2] as $key => $match) {
|
foreach ($matches[2] as $key => $match) {
|
||||||
//remove from search pattern
|
//remove from search pattern
|
||||||
|
@ -165,6 +165,17 @@ class SearchProviderTest extends \PHPUnit_Framework_TestCase
|
|||||||
), $terms);
|
), $terms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testArgumentNameWithTrait()
|
||||||
|
{
|
||||||
|
$terms = $this->p('date-from:2016-05-04');
|
||||||
|
|
||||||
|
$this->assertEquals(array(
|
||||||
|
'_domain' => null,
|
||||||
|
'date-from' => '2016-05-04',
|
||||||
|
'_default' => ''
|
||||||
|
), $terms);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the behaviour when no domain is provided in the search pattern :
|
* Test the behaviour when no domain is provided in the search pattern :
|
||||||
* the default search should be enabled
|
* the default search should be enabled
|
||||||
|
Loading…
x
Reference in New Issue
Block a user