mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Update class for mapping type constants
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Alchemy\Tests\Phrasea\SearchEngine\AST;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\AST\Context;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\AST\TextNode;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\FieldMapping;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Mapping;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\Field;
|
||||
@@ -42,7 +43,7 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testQueryBuild()
|
||||
{
|
||||
$field = new Field('foo', Mapping::TYPE_STRING, ['private' => false]);
|
||||
$field = new Field('foo', FieldMapping::TYPE_STRING, ['private' => false]);
|
||||
$query_context = $this->prophesize(QueryContext::class);
|
||||
$query_context->getUnrestrictedFields()->willReturn([$field]);
|
||||
$query_context->getPrivateFields()->willReturn([]);
|
||||
@@ -66,8 +67,8 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testQueryBuildWithPrivateFields()
|
||||
{
|
||||
$public_field = new Field('foo', Mapping::TYPE_STRING, ['private' => false]);
|
||||
$private_field = new Field('bar', Mapping::TYPE_STRING, [
|
||||
$public_field = new Field('foo', FieldMapping::TYPE_STRING, ['private' => false]);
|
||||
$private_field = new Field('bar', FieldMapping::TYPE_STRING, [
|
||||
'private' => true,
|
||||
'used_by_collections' => [1, 2, 3]
|
||||
]);
|
||||
@@ -125,7 +126,7 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testQueryBuildWithConcepts()
|
||||
{
|
||||
$field = new Field('foo', Mapping::TYPE_STRING, ['private' => false]);
|
||||
$field = new Field('foo', FieldMapping::TYPE_STRING, ['private' => false]);
|
||||
$query_context = $this->prophesize(QueryContext::class);
|
||||
$query_context->getUnrestrictedFields()->willReturn([$field]);
|
||||
$query_context->getPrivateFields()->willReturn([]);
|
||||
@@ -161,8 +162,8 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testQueryBuildWithPrivateFieldAndConcept()
|
||||
{
|
||||
$public_field = new Field('foo', Mapping::TYPE_STRING, ['private' => false]);
|
||||
$private_field = new Field('bar', Mapping::TYPE_STRING, [
|
||||
$public_field = new Field('foo', FieldMapping::TYPE_STRING, ['private' => false]);
|
||||
$private_field = new Field('bar', FieldMapping::TYPE_STRING, [
|
||||
'private' => true,
|
||||
'used_by_collections' => [1, 2, 3]
|
||||
]);
|
||||
|
Reference in New Issue
Block a user