From e09c176f3f7464ea4098359d3ba8a2122eeebc43 Mon Sep 17 00:00:00 2001 From: Jean-Yves Gaulier Date: Tue, 19 Nov 2019 17:34:27 +0100 Subject: [PATCH] PHRAS-2831_port-truncation_4.1 fix tests --- .../Phrasea/SearchEngine/AST/TextNodeTest.php | 14 ++++++++++++++ .../SearchEngine/Search/QueryContextTest.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/Alchemy/Tests/Phrasea/SearchEngine/AST/TextNodeTest.php b/tests/Alchemy/Tests/Phrasea/SearchEngine/AST/TextNodeTest.php index b2cde860b1..571cbd93de 100644 --- a/tests/Alchemy/Tests/Phrasea/SearchEngine/AST/TextNodeTest.php +++ b/tests/Alchemy/Tests/Phrasea/SearchEngine/AST/TextNodeTest.php @@ -48,6 +48,7 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase $query_context->getUnrestrictedFields()->willReturn([$field]); $query_context->getPrivateFields()->willReturn([]); $query_context->localizeField($field)->willReturn(['foo.fr', 'foo.en']); + $query_context->truncationField($field)->willReturn([]); $node = new TextNode('bar', new Context('baz')); $query = $node->buildQuery($query_context->reveal()); @@ -80,12 +81,18 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase $query_context ->localizeField($public_field) ->willReturn(['foo.fr', 'foo.en']); + $query_context + ->truncationField($public_field) + ->willReturn([]); $query_context ->getPrivateFields() ->willReturn([$private_field]); $query_context ->localizeField($private_field) ->willReturn(['private_caption.bar.fr', 'private_caption.bar.en']); + $query_context + ->truncationField($private_field) + ->willReturn([]); $node = new TextNode('baz'); $query = $node->buildQuery($query_context->reveal()); @@ -136,6 +143,7 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase $query_context->getUnrestrictedFields()->willReturn([$field]); $query_context->getPrivateFields()->willReturn([]); $query_context->localizeField($field)->willReturn(['foo.fr', 'foo.en']); + $query_context->truncationField($field)->willReturn([]); $node = new TextNode('bar'); $node->setConcepts([ @@ -180,12 +188,18 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase $query_context ->localizeField($public_field) ->willReturn(['foo.fr', 'foo.en']); + $query_context + ->truncationField($public_field) + ->willReturn([]); $query_context ->getPrivateFields() ->willReturn([$private_field]); $query_context ->localizeField($private_field) ->willReturn(['private_caption.bar.fr', 'private_caption.bar.en']); + $query_context + ->truncationField($private_field) + ->willReturn([]); $node = new TextNode('baz'); $node->setConcepts([ diff --git a/tests/Alchemy/Tests/Phrasea/SearchEngine/Search/QueryContextTest.php b/tests/Alchemy/Tests/Phrasea/SearchEngine/Search/QueryContextTest.php index 268cd917c5..093ee51f3a 100644 --- a/tests/Alchemy/Tests/Phrasea/SearchEngine/Search/QueryContextTest.php +++ b/tests/Alchemy/Tests/Phrasea/SearchEngine/Search/QueryContextTest.php @@ -53,7 +53,7 @@ class QueryContextTest extends \PHPUnit_Framework_TestCase $context = new QueryContext(null, $structure->reveal(), [], 'fr'); $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()); } }