You are here

protected function MetatagTest::importData in Entity Share 8.3

Import data from remote and clear the content.

1 call to MetatagTest::importData()
MetatagTest::testMetatagFieldEnhancer in modules/entity_share_client/tests/src/Functional/MetatagTest.php
Test the Metatag resource field enhancer plugin.

File

modules/entity_share_client/tests/src/Functional/MetatagTest.php, line 223

Class

MetatagTest
General functional test class for metatag field.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

protected function importData() {
  $channel_infos = $this->remoteManager
    ->getChannelsInfos($this->remote);
  $channel_url = $channel_infos['node_es_test_en']['url'];
  $response = $this->remoteManager
    ->jsonApiRequest($this->remote, 'GET', $channel_url);
  $json = Json::decode((string) $response
    ->getBody());
  $this
    ->deleteContent();
  $this->entities = [];
  $import_context = new ImportContext($this->remote
    ->id(), 'node_es_test_en', $this::IMPORT_CONFIG_ID);
  $this->importService
    ->prepareImport($import_context);
  $this->importService
    ->importEntityListData(EntityShareUtility::prepareData($json['data']));
}