Permalink
Browse files

Perform all checks down the chain

Just validating the existence of a property doesn't presume it is automatically created by the dynamic template.
  • Loading branch information...
1 parent 3c8b7a5 commit 3d5a09cbbd7875a7a0564f8e416b551d81775822 @jappievw jappievw committed Apr 2, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 test/lib/Elastica/Test/Type/MappingTest.php
@@ -217,6 +217,13 @@ public function testDynamicTemplate()
$this->assertArrayHasKey('properties', $newMapping['person'],
'Person type doesnt have any properties. Document properly added?');
$this->assertArrayHasKey('multiname', $newMapping['person']['properties'],
- 'The multi* matcher did not create a mapping for the multiname property when indexing the document.');
+ 'The multiname property is not added to the mapping. Document properly added?');
+ $this->assertArrayHasKey('fields', $newMapping['person']['properties']['multiname'],
+ 'The multiname field of the Person type is presumably not a multi_field type. Dynamic mapping not applied?');
+ $this->assertArrayHasKey('org', $newMapping['person']['properties']['multiname']['fields'],
+ 'The multi* matcher did not create a mapping for the multiname.org property when indexing the document.');
+ $this->assertArrayHasKey('index', $newMapping['person']['properties']['multiname']['fields']['org'],
+ 'Indexing status of the multiname.org not available. Dynamic mapping not fully applied!');
+ $this->assertEquals('not_analyzed', $newMapping['person']['properties']['multiname']['fields']['org']['index']);
}
}

0 comments on commit 3d5a09c

Please sign in to comment.