mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 02:13:15 +00:00
Fix IN search regression from 40e2df6c3f
This commit is contained in:
@@ -34,7 +34,7 @@ class QueryContext
|
||||
}
|
||||
}
|
||||
|
||||
return new static($this->locales, $this->queryLocale, $fields);
|
||||
return new static($this->structure, $this->locales, $this->queryLocale, $fields);
|
||||
}
|
||||
|
||||
public function getRawFields()
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\SearchEngine\Search;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\Structure;
|
||||
|
||||
class QueryContextTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testFieldNarrowing()
|
||||
{
|
||||
$structure = $this->prophesize(Structure::class)->reveal();
|
||||
$available_locales = ['ab', 'cd', 'ef'];
|
||||
$context = new QueryContext($structure, $available_locales, 'fr');
|
||||
$narrowed = $context->narrowToFields(['some_field']);
|
||||
$this->assertEquals(['some_field'], $narrowed->getFields());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user