mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Implement private fields on range an equal nodes
New QueryContext::get() method Removed QueryContext::normalizeField(), can be replaced with get() and a call to Field::getIndexField().
This commit is contained in:
@@ -22,19 +22,6 @@ class QueryContextTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(['some_field'], $narrowed->getFields());
|
||||
}
|
||||
|
||||
public function testFieldNormalization()
|
||||
{
|
||||
$public_field = new Field('foo', Mapping::TYPE_STRING, ['private' => false]);
|
||||
$restricted_field = new Field('bar', Mapping::TYPE_STRING, ['private' => true]);
|
||||
$structure = $this->prophesize(Structure::class);
|
||||
$structure->get('foo')->willReturn($public_field);
|
||||
$structure->get('bar')->willReturn($restricted_field);
|
||||
|
||||
$context = new QueryContext($structure->reveal(), [], 'fr');
|
||||
$this->assertEquals('caption.foo', $context->normalizeField('foo'));
|
||||
$this->assertEquals('private_caption.bar', $context->normalizeField('bar'));
|
||||
}
|
||||
|
||||
public function testGetUnrestrictedFields()
|
||||
{
|
||||
$foo_field = new Field('foo', Mapping::TYPE_STRING, ['private' => false]);
|
||||
|
Reference in New Issue
Block a user