Integrates Aerospike into Codeception tests.
To use this module on your machine, you need at least:
- Aerospike Server >= 3.5.3
- Aerospike PHP Extension
- Latest Codeception release
Create the composer.json file as follows:
{
"require-dev": {
"codeception/codeception": "^2.2",
"codeception/aerospike-module": "^1.0"
}
}Then install dependencies:
$ php composer.phar installmodules:
- 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 prefixThen regenerate base class for unit suite
$ vendor/bin/codecept buildGrabs 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']);Aerospike Module is open-sourced software licensed under the MIT License.
© 2015-2022 Codeception Team and contributors