codeception / aerospike-module
Aerospike 模块用于 Codeception。将 Aerospike 集成到 Codeception 测试中。
v1.0.3
2019-07-25 16:10 UTC
Requires
- codeception/codeception: ^2 || ^3
README
将 Aerospike 集成到 Codeception 测试中。
开始使用
要求
要在您的机器上使用此模块,您至少需要以下条件
- Aerospike 服务器 >= 3.5.3
- Aerospike PHP 扩展
- 最新的 Codeception 版本
安装
创建如下所示的 composer.json
文件
{ "require-dev": { "codeception/codeception": "^2.2", "codeception/aerospike-module": "^1.0" } }
然后安装依赖项
$ php composer.phar install
示例 (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
然后为单元测试套件重新生成基类
$ vendor/bin/codecept build
使用方法
通过键从 Aerospike 获取值
$users_count = $I->grabValueFromAerospike('users_count');
检查 Aerospike 中的项是否存在且与预期相同
$I->seeInAerospike('key'); $I->seeInAerospike('key', 'value');
检查 Aerospike 中的项不存在或与预期相同
$I->dontSeeInAerospike('key'); $I->dontSeeInAerospike('key', 'value');
将数据插入到 Aerospike 数据库中
$I->haveInAerospike('users', ['name' => 'miles', 'email' => 'miles@davis.com']);
变更日志
许可证
Aerospike 模块是开源软件,根据 MIT 许可证授权。
© 2015-2022 Codeception 团队及贡献者