PHP code example of zestic / codeception-graphql
1. Go to this page and download the library: Download zestic/codeception-graphql library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zestic / codeception-graphql example snippets
class PingCest
{
public function testPing(AcceptanceTester $I)
{
$query = 'query{ping {response}}';
$I->sendGraphQL($query);
$expected = [
'ping' => [
'response' => 'pong',
],
];
$I->assertEquals($expected, $I->grabResponseData());
}
}