1 | <?php |
||
22 | abstract class AbstractElasticsearchTestCase extends WebTestCase |
||
23 | { |
||
24 | protected static $cachedContainer; |
||
25 | |||
26 | /** |
||
27 | * @var IndexService[] |
||
28 | */ |
||
29 | private $indexes = []; |
||
30 | |||
31 | //You may use setUp() for your personal needs. |
||
32 | protected function setUp() |
||
35 | |||
36 | /** |
||
37 | * Can be overwritten in child class to populate elasticsearch index with the data. |
||
38 | * |
||
39 | * Example: |
||
40 | * "/This/Should/Be/Index/Document/Namespace" => |
||
41 | * [ |
||
42 | * '_doc' => [ |
||
43 | * [ |
||
44 | * '_id' => 1, |
||
45 | * 'title' => 'foo', |
||
46 | * ], |
||
47 | * [ |
||
48 | * '_id' => 2, |
||
49 | * 'title' => 'bar', |
||
50 | * ] |
||
51 | * ] |
||
52 | * ] |
||
53 | * |
||
54 | * @return array |
||
55 | */ |
||
56 | protected function getDataArray(): array |
||
60 | |||
61 | private function populateElastic(IndexService $indexService, array $documents = []) |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | protected function tearDown(): void |
||
84 | |||
85 | protected function getContainer($reinitialize = false, $kernelOptions = []): ContainerInterface |
||
95 | |||
96 | protected function getIndex($namespace, $createIndex = true): IndexService |
||
119 | } |
||
120 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.