bauhaus/dbasserture
最新稳定版本:v1.6.0
Composer 安装命令:
composer require bauhaus/dbasserture
包简介
DB fixture and assertion for integration tests
关键字:
README 文档
README
DB Asserture
This tool aims to help the DB setup and assertion in a integration tests context.
use Bauhaus\DbAsserture\DbAssertureFactory; $factory = new DbAssertureFactory(); $dbAsserture = $factory->fromDsn('mysql://user:pass@host:port/dbname'); // Clean tables $dbAsserture->clean('table_name', 'another_table_name'); // Insert registers $dbAsserture->insert('table_name', ['id' => 1, 'name' => 'Name']); $dbAsserture->insert('table_name', ['id' => 1, 'name' => 'Name'], ['id' => 2, 'name' => 'Another name'], ); // Select registers $dbAsserture->select('table_name', ['name' => 'John']); // return many registers with all fields matching provided filter $dbAsserture->selectOne('table_name', ['id' => 1]); // return one register with all fields matching provided filters // Assert if is registered in database $dbAsserture->assertOneIsRegistered('table_name', ['id' => 1, 'name' => 'Name']); // return true or throw exception
统计信息
- 总下载量: 12.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-27