xaddax / codeception-graphql
GraphQL extension for Codeception
Installs: 14 473
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 2
Open Issues: 0
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
#No longer supported, use zestic/codeception-graphql instead
Codeception GraphQL
A codeception extension for calling GraphQL endpoints
This requires a running server, you can use Codeception PhpBuiltInServer if needed.
Installation
composer require xaddax/codeception-graphql --dev
To configure
In your acceptance.suite.yml file
modules: enabled: - GraphQL: url: 'http://localhost:8080/'
Testing
To use it in a test
class PingCest { public function testPing(AcceptanceTester $I) { $query = 'query{ping {response}}'; $I->sendGraphQL($query); $expected = [ 'ping' => [ 'response' => 'pong', ], ]; $I->assertEquals($expected, $I->grabResponseData()); } }