Code Duplication    Length = 12-14 lines in 2 locations

tests/ElasticsearchTestBase.php 2 locations

@@ 223-236 (lines=14) @@
220
	}
221
222
223
	public function checkNumberOfIndexedDocuments($expectedAmount) {
224
		$index = $this->service->getIndex();
225
		$status = $index->getStatus()->getData();
226
227
		$numberDocsInIndex = -1; // flag value for not yet indexed
228
229
		if (isset($status['indices']['elastica_ss_module_test_en_us']['docs'])) {
230
			$numberDocsInIndex = $status['indices']['elastica_ss_module_test_en_us']['docs']['num_docs'];
231
		} else {
232
			$numberDocsInIndex = 0;
233
		}
234
235
		$this->assertEquals($expectedAmount,$numberDocsInIndex);
236
	}
237
238
	/*
239
	Get the number of documents in an index.  It is assumed the index exists, if not the test will fail
@@ 241-252 (lines=12) @@
238
	/*
239
	Get the number of documents in an index.  It is assumed the index exists, if not the test will fail
240
	 */
241
	public function getNumberOfIndexedDocuments() {
242
		$index = $this->service->getIndex();
243
		$status = $index->getStatus()->getData();
244
245
		$numberDocsInIndex = -1; // flag value for not yet indexed
246
		if (isset($status['indices']['elastica_ss_module_test_en_us']['docs'])) {
247
			$numberDocsInIndex = $status['indices']['elastica_ss_module_test_en_us']['docs']['num_docs'];
248
		}
249
250
		$this->assertGreaterThan(-1, $numberDocsInIndex);
251
		return $numberDocsInIndex;
252
	}
253
}
254