class DeleteFeedItemTest
Same name and namespace in other branches
- 8.9.x core/modules/aggregator/tests/src/Functional/DeleteFeedItemTest.php \Drupal\Tests\aggregator\Functional\DeleteFeedItemTest
Delete feed items from a feed.
@group aggregator @group legacy
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\aggregator\Functional\AggregatorTestBase extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\aggregator\Functional\DeleteFeedItemTest extends \Drupal\Tests\aggregator\Functional\AggregatorTestBase
- class \Drupal\Tests\aggregator\Functional\AggregatorTestBase extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of DeleteFeedItemTest
File
-
core/
modules/ aggregator/ tests/ src/ Functional/ DeleteFeedItemTest.php, line 13
Namespace
Drupal\Tests\aggregator\FunctionalView source
class DeleteFeedItemTest extends AggregatorTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests running "delete items" from 'admin/config/services/aggregator' page.
*/
public function testDeleteFeedItem() {
// Create a bunch of test feeds.
$feed_urls = [];
// No last-modified, no etag.
$feed_urls[] = Url::fromRoute('aggregator_test.feed', [], [
'absolute' => TRUE,
])->toString();
// Last-modified, but no etag.
$feed_urls[] = Url::fromRoute('aggregator_test.feed', [
'use_last_modified' => 1,
], [
'absolute' => TRUE,
])->toString();
// No Last-modified, but etag.
$feed_urls[] = Url::fromRoute('aggregator_test.feed', [
'use_last_modified' => 0,
'use_etag' => 1,
], [
'absolute' => TRUE,
])->toString();
// Last-modified and etag.
$feed_urls[] = Url::fromRoute('aggregator_test.feed', [
'use_last_modified' => 1,
'use_etag' => 1,
], [
'absolute' => TRUE,
])->toString();
foreach ($feed_urls as $feed_url) {
$feed = $this->createFeed($feed_url);
// Update and delete items two times in a row to make sure that removal
// resets all 'modified' information (modified, etag, hash) and allows for
// immediate update. There's 8 items in the feed, but one has an empty
// title and is skipped.
$this->updateAndDelete($feed, 7);
$this->updateAndDelete($feed, 7);
$this->updateAndDelete($feed, 7);
// Delete feed.
$this->deleteFeed($feed);
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.