You are here

JsonLdSchemaTest.php in Thunder 6.2.x

File

modules/thunder_gqls/tests/src/Functional/JsonLdSchemaTest.php
View source
<?php

namespace Drupal\Tests\thunder_gqls\Functional;


/**
 * Test the schema.
 *
 * @group Thunder
 */
class JsonLdSchemaTest extends ThunderGqlsTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'schema_article',
  ];

  /**
   * Tests the jsonld extension.
   *
   * @throws \GuzzleHttp\Exception\GuzzleException
   */
  public function testSchema() {
    $tags = $this
      ->config('metatag.metatag_defaults.node__article')
      ->get('tags');
    $tags['schema_article_type'] = 'Article';
    $this
      ->config('metatag.metatag_defaults.node__article')
      ->set('tags', $tags)
      ->save();
    $extensions = $this
      ->config('graphql.graphql_servers.thunder_graphql')
      ->get('schema_configuration.thunder.extensions');
    $extensions['thunder_jsonld'] = 'thunder_jsonld';
    $this
      ->config('graphql.graphql_servers.thunder_graphql')
      ->set('schema_configuration.thunder.extensions', $extensions)
      ->save();
    $this
      ->drupalLogin($this->graphqlUser);
    $this
      ->runAndTestQuery('jsonld');
  }

}

Classes

Namesort descending Description
JsonLdSchemaTest Test the schema.