You are here

public function FeedTest::testStartCronImportFailsOnLockedFeed in Feeds 8.3

@covers ::startCronImport

File

tests/src/Kernel/Entity/FeedTest.php, line 167

Class

FeedTest
@coversDefaultClass \Drupal\feeds\Entity\Feed @group feeds

Namespace

Drupal\Tests\feeds\Kernel\Entity

Code

public function testStartCronImportFailsOnLockedFeed() {
  $this
    ->installSchema('system', [
    'key_value_expire',
  ]);
  $feed = $this
    ->createFeed($this->feedType
    ->id(), [
    'source' => $this
      ->resourcesPath() . '/rss/googlenewstz.rss2',
  ]);

  // Lock a feed.
  $feed
    ->lock();

  // Assert that starting a cron import task now fails.
  $this
    ->expectException(LockException::class);
  $feed
    ->startCronImport();
}