@@ 81-95 (lines=15) @@ | ||
78 | $this->resetter->resetAllIndexes(); |
|
79 | } |
|
80 | ||
81 | public function testResetIndex() |
|
82 | { |
|
83 | $indexConfig = new IndexConfig('index1', [], []); |
|
84 | $this->mockIndex('index1', $indexConfig); |
|
85 | ||
86 | $this->dispatcherExpects([ |
|
87 | [IndexResetEvent::PRE_INDEX_RESET, $this->isInstanceOf(IndexResetEvent::class)], |
|
88 | [IndexResetEvent::POST_INDEX_RESET, $this->isInstanceOf(IndexResetEvent::class)], |
|
89 | ]); |
|
90 | ||
91 | $this->elasticaClient->expects($this->exactly(2)) |
|
92 | ->method('requestEndpoint'); |
|
93 | ||
94 | $this->resetter->resetIndex('index1'); |
|
95 | } |
|
96 | ||
97 | public function testResetIndexWithDifferentName() |
|
98 | { |
|
@@ 97-112 (lines=16) @@ | ||
94 | $this->resetter->resetIndex('index1'); |
|
95 | } |
|
96 | ||
97 | public function testResetIndexWithDifferentName() |
|
98 | { |
|
99 | $indexConfig = new IndexConfig('index1', [], [ |
|
100 | 'elasticSearchName' => 'notIndex1', |
|
101 | ]); |
|
102 | $this->mockIndex('index1', $indexConfig); |
|
103 | $this->dispatcherExpects([ |
|
104 | [IndexResetEvent::PRE_INDEX_RESET, $this->isInstanceOf(IndexResetEvent::class)], |
|
105 | [IndexResetEvent::POST_INDEX_RESET, $this->isInstanceOf(IndexResetEvent::class)], |
|
106 | ]); |
|
107 | ||
108 | $this->elasticaClient->expects($this->exactly(2)) |
|
109 | ->method('requestEndpoint'); |
|
110 | ||
111 | $this->resetter->resetIndex('index1'); |
|
112 | } |
|
113 | ||
114 | public function testResetIndexWithDifferentNameAndAlias() |
|
115 | { |