public function DisabledSchemaCacheTest::testDisabledCacheWithoutCacheMetadata in GraphQL 8.3
Test disabled schema caching without cache metadata.
File
- tests/
src/ Kernel/ Framework/ DisabledSchemaCacheTest.php, line 27
Class
- DisabledSchemaCacheTest
- Test schema caching.
Namespace
Drupal\Tests\graphql\Kernel\FrameworkCode
public function testDisabledCacheWithoutCacheMetadata() {
// Create a first field.
$this
->mockField('foo', [
'id' => 'foo',
'name' => 'foo',
'type' => 'String',
], 'foo');
// Run introspect to populate the schema cache.
$this
->introspect();
// Add another field.
$this
->mockField('bar', [
'id' => 'bar',
'name' => 'bar',
'type' => 'String',
], 'bar');
// Run introspect again, the new field should appear immediately.
$schema = $this
->introspect();
$this
->assertArrayHasKey('bar', $schema['types']['Query']['fields'], 'Schema does not contain the new field.');
}