Fix IN search regression from 40e2df6c3f

This commit is contained in:
Mathieu Darse
2015-06-15 16:13:44 +02:00
parent 2b689a4118
commit 605c943af5
2 changed files with 19 additions and 1 deletions

View File

@@ -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());
}
}