You are here

public function FeedTest::testGetItemCount in Feeds 8.3

@covers ::getItemCount

File

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

Class

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

Namespace

Drupal\Tests\feeds\Kernel\Entity

Code

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

  // Assert that no items were imported yet.
  $this
    ->assertSame(0, $feed
    ->getItemCount());

  // Now import.
  $feed
    ->import();

  // And assert the result.
  $this
    ->assertSame(6, $feed
    ->getItemCount());
}