public function testUpdateDocument()
 {
     $this->createIndex();
     $data = array('name' => 'test' . rand(100, 10000), 'value' => 'myTestVal' . rand(100, 10000));
     $id = $this->createDocument(self::TYPE, $data);
     $this->refreshIndex();
     $updateDocumentRequest = new UpdateDocumentRequest(ES_INDEX, self::TYPE, $this->getSerializer());
     $updateDocumentRequest->setId($id);
     $data['name'] = 'testName';
     $updateDocumentRequest->setBody($data);
     /** @var CreateUpdateDocumentResponse $updateDocumentResponse */
     $updateDocumentResponse = $this->getClient()->send($updateDocumentRequest);
     $this->assertSame(ES_INDEX, $updateDocumentResponse->getIndex());
     $this->assertSame(self::TYPE, $updateDocumentResponse->getType());
     $this->assertSame(2, $updateDocumentResponse->getVersion());
     $this->assertSame($id, $updateDocumentResponse->getId());
     $this->assertFalse($updateDocumentResponse->created());
 }
 public function testCreateResponse()
 {
     $rawData = 'raw data for testing';
     $response = $this->request->createResponse($rawData, $this->serializer);
     $this->assertInstanceOf(self::RESPONSE_CLASS, $response);
 }