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 | protected function getDataDocuments(): array |
||
65 | |||
66 | private function populateDataArray(IndexService $indexService, array $documents = []) |
||
73 | |||
74 | private function populateDocument(IndexService $indexService, array $documents = []) |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | protected function tearDown(): void |
||
97 | |||
98 | protected function getContainer($reinitialize = false, $kernelOptions = []): ContainerInterface |
||
108 | |||
109 | protected function getIndex($namespace, $createIndex = true): IndexService |
||
139 | } |
||
140 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.