ElasticSearchHandlerTest
extends TestCase
in package
Table of Contents
- $client : Client
- $options : array<string|int, mixed>
- providerTestConnectionErrors() : array<string|int, mixed>
- setUp() : mixed
- testConnectionErrors() : mixed
- testHandle() : mixed
- testHandleIntegration() : mixed
- Integration test using localhost Elastic Search server
- testOptions() : mixed
- testSetFormatter() : mixed
- testSetFormatterInvalid() : mixed
- getCreatedDocId() : string|null
- Return last created document id from ES response
- getDocSourceFromElastic() : array<string|int, mixed>
- Retrieve document by id from Elasticsearch
- getIdentityFormatter() : FormatterInterface
- getMultipleRecords() : array<string|int, mixed>
- getRecord() : array<string|int, mixed>
Properties
$client
protected
Client
$client
mock
$options
protected
array<string|int, mixed>
$options
= array('index' => 'my_index', 'type' => 'doc_type')
Default handler options
Methods
providerTestConnectionErrors()
public
providerTestConnectionErrors() : array<string|int, mixed>
Return values
array<string|int, mixed> —setUp()
public
setUp() : mixed
Return values
mixed —testConnectionErrors()
public
testConnectionErrors(mixed $ignore, mixed $expectedError) : mixed
Parameters
- $ignore : mixed
- $expectedError : mixed
Tags
Return values
mixed —testHandle()
public
testHandle() : mixed
Tags
Return values
mixed —testHandleIntegration()
Integration test using localhost Elastic Search server
public
testHandleIntegration() : mixed
Tags
Return values
mixed —testOptions()
public
testOptions() : mixed
Tags
Return values
mixed —testSetFormatter()
public
testSetFormatter() : mixed
Tags
Return values
mixed —testSetFormatterInvalid()
public
testSetFormatterInvalid() : mixed
Tags
Return values
mixed —getCreatedDocId()
Return last created document id from ES response
protected
getCreatedDocId(Response $response) : string|null
Parameters
- $response : Response
-
Elastica Response object
Return values
string|null —getDocSourceFromElastic()
Retrieve document by id from Elasticsearch
protected
getDocSourceFromElastic(Client $client, string $index, string $type, string $documentId) : array<string|int, mixed>
Parameters
- $client : Client
-
Elastica client
- $index : string
- $type : string
- $documentId : string
Return values
array<string|int, mixed> —getIdentityFormatter()
protected
getIdentityFormatter() : FormatterInterface
Return values
FormatterInterface —getMultipleRecords()
protected
getMultipleRecords() : array<string|int, mixed>
Return values
array<string|int, mixed> —getRecord()
protected
getRecord([mixed $level = Logger::WARNING ][, mixed $message = 'test' ][, mixed $context = array() ]) : array<string|int, mixed>
Parameters
- $level : mixed = Logger::WARNING
- $message : mixed = 'test'
- $context : mixed = array()
Return values
array<string|int, mixed> —Record