Skip to content

Commit 401446e

Browse files
committed
�Add integration testing around _parent mapping
1 parent 32d190f commit 401446e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Tests/Functional/MappingToElasticaTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@ public function testResetIndexAddsMappings()
3232
$this->assertTrue($mapping['type']['properties']['field1']['store']);
3333
$this->assertArrayNotHasKey('store', $mapping['type']['properties']['field2']);
3434

35+
$type = $this->getType($client, 'type');
36+
$mapping = $type->getMapping()['type'];
37+
$this->assertEquals('parent', $mapping['_parent']['type']);
38+
3539
$parent = $this->getType($client, 'parent');
36-
$mapping = $parent->getMapping();
40+
$mapping = $parent->getMapping()['parent'];
3741

38-
$this->assertEquals('my_analyzer', $mapping['parent']['index_analyzer']);
39-
$this->assertEquals('whitespace', $mapping['parent']['search_analyzer']);
42+
$this->assertEquals('my_analyzer', $mapping['index_analyzer']);
43+
$this->assertEquals('whitespace', $mapping['search_analyzer']);
4044
}
4145

4246
public function testResetType()

0 commit comments

Comments
 (0)