codeception/aerospike-module

Aerospike Module for Codeception. Integrates Aerospike into Codeception tests.

v1.0.3 2019-07-25 16:10 UTC

This package is auto-updated.

Last update: 2022-04-28 01:59:28 UTC


README

Integrates Aerospike into Codeception tests.

Get Started

Requirements

To use this module on your machine, you need at least:

Installation

Create the composer.json file as follows:

{
    "require-dev": {
        "codeception/codeception": "^2.2",
        "codeception/aerospike-module": "^1.0"
    }
}

Then install dependencies:

$ php composer.phar install

Example (unit.suite.yml)

modules:
    - Aerospike:
         addr: '127.0.0.1' # Aerospike host to connect
         port: 3000        # default Aerospike port
         set: 'cache'      # the Aerospike set to store data
         namespace: 'test' # the Aerospike namespace to store data
         reconnect: false  # whether the module should reconnect to the Aerospike before each test
         prefix: 'prefix_' # the key prefix

Then regenerate base class for unit suite

$ vendor/bin/codecept build

Usage

Grabs value from Aerospike by key:

$users_count = $I->grabValueFromAerospike('users_count');

Checks item in Aerospike exists and the same as expected:

$I->seeInAerospike('key');
$I->seeInAerospike('key', 'value');

Checks item in Aerospike does not exist or is the same as expected:

$I->dontSeeInAerospike('key');
$I->dontSeeInAerospike('key', 'value');

Inserts data into Aerospike database:

$I->haveInAerospike('users', ['name' => 'miles', 'email' => 'miles@davis.com']);

Changelog

Changelog

License

Aerospike Module is open-sourced software licensed under the MIT License.

© 2015-2021 Codeception Team and contributors