Newer
Older
Angie Byron
committed
<?php
namespace Drupal\aggregator\Tests;
/**
* Tests the fetcher plugins functionality and discoverability.
Angie Byron
committed
*
* @group aggregator
Angie Byron
committed
* @see \Drupal\aggregator_test\Plugin\aggregator\fetcher\TestFetcher.
*/
class FeedFetcherPluginTest extends AggregatorTestBase {
/**
* {@inheritdoc}
*/
Alex Pott
committed
protected function setUp() {
Angie Byron
committed
parent::setUp();
// Enable test plugins.
$this->enableTestPlugins();
// Create some nodes.
$this->createSampleNodes();
}
/**
* Test fetching functionality.
*/
public function testfetch() {
// Create feed with local url.
$feed = $this->createFeed();
$this->updateFeedItems($feed);
$this->assertFalse(empty($feed->items));
// Delete items and restore checked property to 0.
$this->deleteFeedItems($feed);
Angie Byron
committed
// Change its name and try again.
Angie Byron
committed
$feed->setTitle('Do not fetch');
Angie Byron
committed
$feed->save();
$this->updateFeedItems($feed);
// Fetch should fail due to feed name.
$this->assertTrue(empty($feed->items));
}
}