|
@@ 357-374 (lines=18) @@
|
| 354 |
|
call_user_func_array(array($expectation, 'withConsecutive'), $events); |
| 355 |
|
} |
| 356 |
|
|
| 357 |
|
private function mockIndex($indexName, IndexConfig $config, $mapping = array()) |
| 358 |
|
{ |
| 359 |
|
$this->configManager->expects($this->atLeast(1)) |
| 360 |
|
->method('getIndexConfiguration') |
| 361 |
|
->with($indexName) |
| 362 |
|
->will($this->returnValue($config)); |
| 363 |
|
$index = new Index($this->elasticaClient, $indexName); |
| 364 |
|
$this->indexManager->expects($this->any()) |
| 365 |
|
->method('getIndex') |
| 366 |
|
->with($indexName) |
| 367 |
|
->willReturn($index); |
| 368 |
|
$this->mappingBuilder->expects($this->any()) |
| 369 |
|
->method('buildIndexMapping') |
| 370 |
|
->with($config) |
| 371 |
|
->willReturn($mapping); |
| 372 |
|
|
| 373 |
|
return $index; |
| 374 |
|
} |
| 375 |
|
|
| 376 |
|
private function mockIndexTemplate($indexTemplateName, IndexTemplateConfig $config, $mapping = array()) |
| 377 |
|
{ |
|
@@ 376-393 (lines=18) @@
|
| 373 |
|
return $index; |
| 374 |
|
} |
| 375 |
|
|
| 376 |
|
private function mockIndexTemplate($indexTemplateName, IndexTemplateConfig $config, $mapping = array()) |
| 377 |
|
{ |
| 378 |
|
$this->configManager->expects($this->atLeast(1)) |
| 379 |
|
->method('getIndexTemplateConfiguration') |
| 380 |
|
->with($indexTemplateName) |
| 381 |
|
->will($this->returnValue($config)); |
| 382 |
|
$index = new IndexTemplate($this->elasticaClient, $indexTemplateName); |
| 383 |
|
$this->indexManager->expects($this->any()) |
| 384 |
|
->method('getIndexTemplate') |
| 385 |
|
->with($indexTemplateName) |
| 386 |
|
->willReturn($index); |
| 387 |
|
$this->mappingBuilder->expects($this->any()) |
| 388 |
|
->method('buildIndexTemplateMapping') |
| 389 |
|
->with($config) |
| 390 |
|
->willReturn($mapping); |
| 391 |
|
|
| 392 |
|
return $index; |
| 393 |
|
} |
| 394 |
|
|
| 395 |
|
private function mockType($typeName, $indexName, TypeConfig $typeConfig, IndexConfig $indexConfig, $mapping = array()) |
| 396 |
|
{ |