mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
PHRAS-2831_port-truncation_4.1
fix tests
This commit is contained in:
@@ -48,6 +48,7 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
|
|||||||
$query_context->getUnrestrictedFields()->willReturn([$field]);
|
$query_context->getUnrestrictedFields()->willReturn([$field]);
|
||||||
$query_context->getPrivateFields()->willReturn([]);
|
$query_context->getPrivateFields()->willReturn([]);
|
||||||
$query_context->localizeField($field)->willReturn(['foo.fr', 'foo.en']);
|
$query_context->localizeField($field)->willReturn(['foo.fr', 'foo.en']);
|
||||||
|
$query_context->truncationField($field)->willReturn([]);
|
||||||
|
|
||||||
$node = new TextNode('bar', new Context('baz'));
|
$node = new TextNode('bar', new Context('baz'));
|
||||||
$query = $node->buildQuery($query_context->reveal());
|
$query = $node->buildQuery($query_context->reveal());
|
||||||
@@ -80,12 +81,18 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
|
|||||||
$query_context
|
$query_context
|
||||||
->localizeField($public_field)
|
->localizeField($public_field)
|
||||||
->willReturn(['foo.fr', 'foo.en']);
|
->willReturn(['foo.fr', 'foo.en']);
|
||||||
|
$query_context
|
||||||
|
->truncationField($public_field)
|
||||||
|
->willReturn([]);
|
||||||
$query_context
|
$query_context
|
||||||
->getPrivateFields()
|
->getPrivateFields()
|
||||||
->willReturn([$private_field]);
|
->willReturn([$private_field]);
|
||||||
$query_context
|
$query_context
|
||||||
->localizeField($private_field)
|
->localizeField($private_field)
|
||||||
->willReturn(['private_caption.bar.fr', 'private_caption.bar.en']);
|
->willReturn(['private_caption.bar.fr', 'private_caption.bar.en']);
|
||||||
|
$query_context
|
||||||
|
->truncationField($private_field)
|
||||||
|
->willReturn([]);
|
||||||
|
|
||||||
$node = new TextNode('baz');
|
$node = new TextNode('baz');
|
||||||
$query = $node->buildQuery($query_context->reveal());
|
$query = $node->buildQuery($query_context->reveal());
|
||||||
@@ -136,6 +143,7 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
|
|||||||
$query_context->getUnrestrictedFields()->willReturn([$field]);
|
$query_context->getUnrestrictedFields()->willReturn([$field]);
|
||||||
$query_context->getPrivateFields()->willReturn([]);
|
$query_context->getPrivateFields()->willReturn([]);
|
||||||
$query_context->localizeField($field)->willReturn(['foo.fr', 'foo.en']);
|
$query_context->localizeField($field)->willReturn(['foo.fr', 'foo.en']);
|
||||||
|
$query_context->truncationField($field)->willReturn([]);
|
||||||
|
|
||||||
$node = new TextNode('bar');
|
$node = new TextNode('bar');
|
||||||
$node->setConcepts([
|
$node->setConcepts([
|
||||||
@@ -180,12 +188,18 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
|
|||||||
$query_context
|
$query_context
|
||||||
->localizeField($public_field)
|
->localizeField($public_field)
|
||||||
->willReturn(['foo.fr', 'foo.en']);
|
->willReturn(['foo.fr', 'foo.en']);
|
||||||
|
$query_context
|
||||||
|
->truncationField($public_field)
|
||||||
|
->willReturn([]);
|
||||||
$query_context
|
$query_context
|
||||||
->getPrivateFields()
|
->getPrivateFields()
|
||||||
->willReturn([$private_field]);
|
->willReturn([$private_field]);
|
||||||
$query_context
|
$query_context
|
||||||
->localizeField($private_field)
|
->localizeField($private_field)
|
||||||
->willReturn(['private_caption.bar.fr', 'private_caption.bar.en']);
|
->willReturn(['private_caption.bar.fr', 'private_caption.bar.en']);
|
||||||
|
$query_context
|
||||||
|
->truncationField($private_field)
|
||||||
|
->willReturn([]);
|
||||||
|
|
||||||
$node = new TextNode('baz');
|
$node = new TextNode('baz');
|
||||||
$node->setConcepts([
|
$node->setConcepts([
|
||||||
|
@@ -53,7 +53,7 @@ class QueryContextTest extends \PHPUnit_Framework_TestCase
|
|||||||
$context = new QueryContext(null, $structure->reveal(), [], 'fr');
|
$context = new QueryContext(null, $structure->reveal(), [], 'fr');
|
||||||
$this->assertEquals([$foo_field, $bar_field], $context->getPrivateFields());
|
$this->assertEquals([$foo_field, $bar_field], $context->getPrivateFields());
|
||||||
|
|
||||||
$narrowed_context = new QueryContext($structure->reveal(), [], 'fr', ['foo']);
|
$narrowed_context = new QueryContext(null, $structure->reveal(), [], 'fr', ['foo']);
|
||||||
$this->assertEquals([$foo_field], $narrowed_context->getPrivateFields());
|
$this->assertEquals([$foo_field], $narrowed_context->getPrivateFields());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user