https://github.com/codeception/aerospike-module
Aerospike module for Codeception
https://github.com/codeception/aerospike-module
Last synced: 4 months ago
JSON representation
Aerospike module for Codeception
- Host: GitHub
- URL: https://github.com/codeception/aerospike-module
- Owner: Codeception
- License: mit
- Created: 2015-12-06T13:16:38.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-05-27T22:21:11.000Z (over 3 years ago)
- Last Synced: 2025-06-27T12:25:20.368Z (4 months ago)
- Language: PHP
- Size: 26.4 KB
- Stars: 3
- Watchers: 7
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Aerospike Module for Codeception
Integrates [Aerospike][1] into Codeception tests.
## Get Started
### Requirements
To use this module on your machine, you need at least:
- [Aerospike Server][1] >= 3.5.3
- [Aerospike PHP Extension][2]
- Latest [Codeception][3] release
### Installation
Create the `composer.json` file as follows:
```json
{
"require-dev": {
"codeception/codeception": "^2.2",
"codeception/aerospike-module": "^1.0"
}
}
```
Then install dependencies:
```sh
$ php composer.phar install
```
### Example (`unit.suite.yml`)
```yaml
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
```sh
$ vendor/bin/codecept build
```
## Usage
Grabs value from Aerospike by key:
```php
$users_count = $I->grabValueFromAerospike('users_count');
```
Checks item in Aerospike exists and the same as expected:
```php
$I->seeInAerospike('key');
$I->seeInAerospike('key', 'value');
```
Checks item in Aerospike does not exist or is the same as expected:
```php
$I->dontSeeInAerospike('key');
$I->dontSeeInAerospike('key', 'value');
```
Inserts data into Aerospike database:
```php
$I->haveInAerospike('users', ['name' => 'miles', 'email' => 'miles@davis.com']);
```
## Changelog
[Changelog](https://github.com/Codeception/Aerospike-module/releases)
## License
Aerospike Module is open-sourced software licensed under the [MIT][4] License.
© 2015-2022 Codeception Team and contributors
[1]: http://www.aerospike.com/
[2]: http://www.aerospike.com/docs/client/php/install/
[3]: https://github.com/Codeception/Codeception
[4]: https://github.com/Codeception/Aerospike-module/blob/master/LICENSE.md