function AddFeedTest::testAddFeed

Create a feed, ensure that it is unique, check the source, and delete the feed.

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AddFeedTest.php, line 25
Definition of Drupal\aggregator\Tests\AddFeedTest.

Class

AddFeedTest
Tests aggregator feed adding.

Namespace

Drupal\aggregator\Tests

Code

function testAddFeed() {
  $feed = $this
    ->createFeed();

  // Check feed data.
  $this
    ->assertEqual($this
    ->getUrl(), url('admin/config/services/aggregator/add/feed', array(
    'absolute' => TRUE,
  )), 'Directed to correct url.');
  $this
    ->assertTrue($this
    ->uniqueFeed($feed->title, $feed->url), 'The feed is unique.');

  // Check feed source.
  $this
    ->drupalGet('aggregator/sources/' . $feed->fid);
  $this
    ->assertResponse(200, 'Feed source exists.');
  $this
    ->assertText($feed->title, 'Page title');
  $this
    ->drupalGet('aggregator/sources/' . $feed->fid . '/categorize');
  $this
    ->assertResponse(200, 'Feed categorization page exists.');

  // Delete feed.
  $this
    ->deleteFeed($feed);
}