function FeedTest::createAnotherEntity

Same name and namespace in other branches
  1. 8.9.x core/modules/jsonapi/tests/src/Functional/FeedTest.php \Drupal\Tests\jsonapi\Functional\FeedTest::createAnotherEntity()

Overrides ResourceTestBase::createAnotherEntity

File

core/modules/aggregator/tests/src/Functional/Jsonapi/FeedTest.php, line 99

Class

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

Namespace

Drupal\Tests\aggregator\Functional\Jsonapi

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.