Download the PHP package subsan/codeception-module-elasticsearch without Composer
On this page you can find all versions of the php package subsan/codeception-module-elasticsearch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download subsan/codeception-module-elasticsearch
More information about subsan/codeception-module-elasticsearch
Files in subsan/codeception-module-elasticsearch
Package codeception-module-elasticsearch
Short Description Elasticsearch module for Codeception
License MIT
Homepage https://github.com/subsan/codeception-module-elasticsearch
Informations about the package codeception-module-elasticsearch
Elasticsearch module for Codeception
Connects to Elasticsearch using elasticsearch/elasticsearch official php client.
Can cleanup by delete all or listed in config indexes after each test or test suite run. Can restore snapshot from fs before each test or test suite.
Installation
Composer
Elasticsearch config
If You need to use snapshots You need add to elasticsearch config path to snapshots
elasticsearch.yml:
Usage
Config
- hosts required - elasticsearch hosts
- snapshotPath - path to snapshot
- snapshotName - snapshot name
- compressedSnapshot: true - is snapshot compressed
- populateBeforeTest: false - whether the snapshot should be loaded before the test suite is started
- populateBeforeSuite: false - whether the snapshot should be reloaded before each test
- cleanup: false - delete indexes from list [indexes] or all (if indexes null) after after each test or test suite finished
- indexes: null - list of indexes to delete after after each test or test suite finished.
Example (acceptance.suite.yml
)
Create snapshot example:
Public Properties
- elasticsearchClient - instance of Elasticsearch\Client
Actions
seeDocumentInElasticsearch
Asserts that a document with the given id exists in the index. Provide index name and document id.
param string
$indexparam string|int
$id
dontSeeDocumentInElasticsearch
Effect is opposite to ->seeDocumentInElasticsearch Asserts there is no document with the given id exists in the index. Provide index name and document id.
param string
$indexparam string|int
$id
grabDocumentFromElasticsearch
Returns response of get document function
The response contains some metadata (index, version, etc.) as well as a _source field, which is the original document that you sent to Elasticsearch.
param string
$index-
param string|int
$id return array
$response
haveInElasticsearch
Inserts document into an index
param string
$indexparam string|int
$id-
param array
$body return array
$response
All versions of codeception-module-elasticsearch with dependencies
elasticsearch/elasticsearch Version ^7.0
codeception/codeception Version ^4.0