JsonApiExtrasTest.php in Entity Share 8.2
File
modules/entity_share_client/tests/src/Functional/JsonApiExtrasTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\entity_share_client\Functional;
use Drupal\node\NodeInterface;
class JsonApiExtrasTest extends EntityShareClientFunctionalTestBase {
public static $modules = [
'jsonapi_extras',
];
protected static $entityTypeId = 'node';
protected static $entityBundleId = 'es_test';
protected static $entityLangcode = 'en';
protected function setUp() {
parent::setUp();
$this->entityTypeManager
->getStorage('jsonapi_resource_config')
->create([
'id' => 'node--es_test',
'disabled' => FALSE,
'path' => 'node/es_test',
'resourceType' => 'node--es_test',
'resourceFields' => [
'title' => [
'fieldName' => 'title',
'publicName' => $this
->randomMachineName(),
'enhancer' => [
'id' => '',
],
'disabled' => FALSE,
],
'langcode' => [
'fieldName' => 'langcode',
'publicName' => $this
->randomMachineName(),
'enhancer' => [
'id' => '',
],
'disabled' => FALSE,
],
],
])
->save();
$this
->postSetupFixture();
}
protected function getEntitiesDataArray() {
return [
'node' => [
'en' => [
'es_test' => $this
->getCompleteNodeInfos([
'status' => [
'value' => NodeInterface::PUBLISHED,
'checker_callback' => 'getValue',
],
]),
],
],
];
}
public function testBasicPull() {
$this
->pullEveryChannels();
$this
->checkCreatedEntities();
}
}