xaddax / codeception-graphql
0.3.0
2020-03-31 04:21 UTC
Requires
- php: >=7.1
- codeception/codeception: ^2.1 || ^3.0 || ^4.0
- euautomation/graphql-client: 0.2
This package is auto-updated.
Last update: 2022-10-20 05:37:33 UTC
README
## 不再受支持,请使用 zestic/codeception-graphql 代替
Codeception GraphQL
用于调用 GraphQL 端点的 Codeception 扩展
这需要一个运行的服务器,如果需要,可以使用 Codeception PhpBuiltInServer。
安装
composer require xaddax/codeception-graphql --dev
配置方法
在您的 acceptance.suite.yml 文件中
modules: enabled: - GraphQL: url: 'http://localhost:8080/'
测试
在测试中使用它
class PingCest { public function testPing(AcceptanceTester $I) { $query = 'query{ping {response}}'; $I->sendGraphQL($query); $expected = [ 'ping' => [ 'response' => 'pong', ], ]; $I->assertEquals($expected, $I->grabResponseData()); } }