Added test coverage for ES store

This commit is contained in:
Tim Nagel 2014-06-26 19:51:16 +10:00
parent 77f2b99a3e
commit 474cbfa979
3 changed files with 7 additions and 1 deletions

View file

@ -69,7 +69,6 @@ class MappingBuilder
return $mapping; return $mapping;
} }
/** /**
* create type mapping object * create type mapping object
* *

View file

@ -28,6 +28,9 @@ class MappingToElasticaTest extends WebTestCase
$mapping = $type->getMapping(); $mapping = $type->getMapping();
$this->assertNotEmpty($mapping, 'Mapping was populated'); $this->assertNotEmpty($mapping, 'Mapping was populated');
$this->assertArrayHasKey('store', $mapping['type']['properties']['field1']);
$this->assertTrue($mapping['type']['properties']['field1']['store']);
$this->assertArrayNotHasKey('store', $mapping['type']['properties']['field2']);
} }
public function testResetType() public function testResetType()
@ -40,6 +43,9 @@ class MappingToElasticaTest extends WebTestCase
$mapping = $type->getMapping(); $mapping = $type->getMapping();
$this->assertNotEmpty($mapping, 'Mapping was populated'); $this->assertNotEmpty($mapping, 'Mapping was populated');
$this->assertArrayHasKey('store', $mapping['type']['properties']['field1']);
$this->assertTrue($mapping['type']['properties']['field1']['store']);
$this->assertArrayNotHasKey('store', $mapping['type']['properties']['field2']);
} }
public function testORMResetIndexAddsMappings() public function testORMResetIndexAddsMappings()

View file

@ -38,6 +38,7 @@ fos_elastica:
field1: ~ field1: ~
field2: field2:
type: integer type: integer
store: false
date: { boost: 5 } date: { boost: 5 }
title: { boost: 8, analyzer: my_analyzer } title: { boost: 8, analyzer: my_analyzer }
content: ~ content: ~