You are here

public function FeedTest::createEntity in JSON:API 8.2

Same name and namespace in other branches
  1. 8 tests/src/Functional/FeedTest.php \Drupal\Tests\jsonapi\Functional\FeedTest::createEntity()

Creates the entity to be tested.

Return value

\Drupal\Core\Entity\EntityInterface The entity to be tested.

Overrides ResourceTestBase::createEntity

File

tests/src/Functional/FeedTest.php, line 70

Class

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

Namespace

Drupal\Tests\jsonapi\Functional

Code

public function createEntity() {
  $feed = Feed::create();
  $feed
    ->set('fid', 1)
    ->setTitle('Feed')
    ->setUrl('http://example.com/rss.xml')
    ->setDescription('Feed Resource Test 1')
    ->setRefreshRate(900)
    ->setLastCheckedTime(123456789)
    ->setQueuedTime(123456789)
    ->setWebsiteUrl('http://example.com')
    ->setImage('http://example.com/feed_logo')
    ->setHash('abcdefg')
    ->setEtag('hijklmn')
    ->setLastModified(123456789)
    ->save();
  return $feed;
}