public function testDeleteDocument()
 {
     $data = array('name' => 'test' . rand(100, 10000), 'value' => 'myTestVal' . rand(100, 10000));
     /** @var CreateUpdateDocumentResponse $createResponse */
     $createResponse = $this->documentRepository->create(ES_INDEX, self::TYPE, $data);
     $this->refreshIndex();
     $this->documentRepository->delete(ES_INDEX, self::TYPE, $createResponse->getId());
     try {
         $this->documentRepository->get(ES_INDEX, self::TYPE, $createResponse->getId());
     } catch (ClientException $exception) {
         $this->assertSame(404, $exception->getCode());
         $this->assertContains('404', $exception->getMessage());
         return;
     }
     $this->fail();
 }
 public function testDelete()
 {
     $index = 'myIndex';
     $type = 'myType';
     $return = 'itsMe';
     $className = 'myClassName';
     $id = 'testId';
     $request = $this->getMockBuilder('Elastification\\Client\\Request\\V1x\\DeleteDocumentRequest')->disableOriginalConstructor()->getMock();
     $request->expects($this->once())->method('setId')->with($id);
     $this->requestRepositoryFactory->expects($this->once())->method('create')->with($className, $index, $type, $this->serializer)->willReturn($request);
     $this->repositoryClassMap->expects($this->once())->method('getClassName')->with(DocumentRepositoryInterface::DELETE_DOCUMENT)->willReturn($className);
     $this->client->expects($this->once())->method('send')->willReturn($return);
     $result = $this->documentRepository->delete($index, $type, $id);
     $this->assertSame($return, $result);
 }