function FeedTest::createAnotherEntity

Same name in other branches
  1. 9 core/modules/aggregator/tests/src/Functional/Jsonapi/FeedTest.php \Drupal\Tests\aggregator\Functional\Jsonapi\FeedTest::createAnotherEntity()

Overrides ResourceTestBase::createAnotherEntity

File

core/modules/jsonapi/tests/src/Functional/FeedTest.php, line 97

Class

FeedTest
JSON:API integration test for the "Feed" content entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function createAnotherEntity($key) {
    
    /* @var \Drupal\aggregator\FeedInterface $duplicate */
    $duplicate = $this->getEntityDuplicate($this->entity, $key);
    $duplicate->set('field_rest_test', 'Duplicate feed entity');
    $duplicate->setUrl("http://example.com/{$key}.xml");
    $duplicate->save();
    return $duplicate;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.