InvalidPayloadTest.php in GraphQL 8.4
File
tests/src/Kernel/Framework/InvalidPayloadTest.php
View source
<?php
namespace Drupal\Tests\graphql\Kernel\Framework;
use Drupal\Tests\graphql\Kernel\GraphQLTestBase;
use Symfony\Component\HttpFoundation\Request;
class InvalidPayloadTest extends GraphQLTestBase {
protected function setUp() : void {
parent::setUp();
$schema = <<<GQL
type Query {
root: String
}
GQL;
$this
->setUpSchema($schema);
}
public function testEmptyPayload() : void {
$request = Request::create('/graphql/test', 'POST', [], [], [], [], '{ invalid');
$this->container
->get('http_kernel')
->handle($request);
}
}