for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Drupal\Tests\graphql_core\Kernel\Entity;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\Tests\graphql_core\Kernel\GraphQLContentTestBase;
/**
* Tests for bundle-less entities.
*
* Test edge cases of entities without bundles (e.g. the user entity).
*/
class BundleLessEntityTest extends GraphQLContentTestBase {
* {@inheritdoc}
protected function setUp() {
parent::setUp();
FieldStorageConfig::create([
'field_name' => 'field_test',
'entity_type' => 'user',
'type' => 'boolean',
'cardinality' => 1,
])->save();
FieldConfig::create([
'bundle' => 'user',
'label' => 'Test',
}
* Test if a field is available on the user type.
* Regression test for: https://github.com/drupal-graphql/graphql/issues/560
public function testConfiguredField() {
$this->assertGraphQLFields([
['User', 'fieldTest', 'Boolean'],
]);