You are here

public function FeedResourceTestBase::createEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/aggregator/tests/src/Functional/Rest/FeedResourceTestBase.php \Drupal\Tests\aggregator\Functional\Rest\FeedResourceTestBase::createEntity()

Creates the entity to be tested.

Return value

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

Overrides EntityResourceTestBase::createEntity

File

core/modules/aggregator/tests/src/Functional/Rest/FeedResourceTestBase.php, line 53

Class

FeedResourceTestBase

Namespace

Drupal\Tests\aggregator\Functional\Rest

Code

public function createEntity() {
  $feed = Feed::create();
  $feed
    ->set('fid', 1)
    ->set('uuid', 'abcdefg')
    ->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;
}