|
@@ 59-73 (lines=15) @@
|
| 56 |
|
$this->resetter->resetAllIndexes(); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
public function testResetIndex() |
| 60 |
|
{ |
| 61 |
|
$indexConfig = new IndexConfig('index1', [], []); |
| 62 |
|
$this->mockIndex('index1', $indexConfig); |
| 63 |
|
|
| 64 |
|
$this->dispatcherExpects([ |
| 65 |
|
[IndexResetEvent::PRE_INDEX_RESET, $this->isInstanceOf('FOS\\ElasticaBundle\\Event\\IndexResetEvent')], |
| 66 |
|
[IndexResetEvent::POST_INDEX_RESET, $this->isInstanceOf('FOS\\ElasticaBundle\\Event\\IndexResetEvent')], |
| 67 |
|
]); |
| 68 |
|
|
| 69 |
|
$this->elasticaClient->expects($this->exactly(2)) |
| 70 |
|
->method('requestEndpoint'); |
| 71 |
|
|
| 72 |
|
$this->resetter->resetIndex('index1'); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
public function testResetIndexWithDifferentName() |
| 76 |
|
{ |
|
@@ 75-90 (lines=16) @@
|
| 72 |
|
$this->resetter->resetIndex('index1'); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
public function testResetIndexWithDifferentName() |
| 76 |
|
{ |
| 77 |
|
$indexConfig = new IndexConfig('index1', [], [ |
| 78 |
|
'elasticSearchName' => 'notIndex1', |
| 79 |
|
]); |
| 80 |
|
$this->mockIndex('index1', $indexConfig); |
| 81 |
|
$this->dispatcherExpects([ |
| 82 |
|
[IndexResetEvent::PRE_INDEX_RESET, $this->isInstanceOf('FOS\\ElasticaBundle\\Event\\IndexResetEvent')], |
| 83 |
|
[IndexResetEvent::POST_INDEX_RESET, $this->isInstanceOf('FOS\\ElasticaBundle\\Event\\IndexResetEvent')], |
| 84 |
|
]); |
| 85 |
|
|
| 86 |
|
$this->elasticaClient->expects($this->exactly(2)) |
| 87 |
|
->method('requestEndpoint'); |
| 88 |
|
|
| 89 |
|
$this->resetter->resetIndex('index1'); |
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
public function testResetIndexWithDifferentNameAndAlias() |
| 93 |
|
{ |