Documentation

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

$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>

testConnectionErrors()

public testConnectionErrors(mixed $ignore, mixed $expectedError) : mixed
Parameters
$ignore : mixed
$expectedError : mixed
Tags
covers
dataProvider

providerTestConnectionErrors

Return values
mixed

testHandleIntegration()

Integration test using localhost Elastic Search server

public testHandleIntegration() : mixed
Tags
covers
covers
covers
covers
Return values
mixed

testSetFormatterInvalid()

public testSetFormatterInvalid() : mixed
Tags
covers
expectedException

InvalidArgumentException

expectedExceptionMessage

ElasticSearchHandler is only compatible with ElasticaFormatter

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

Search results