class ItemWithoutFeedTest
Same name and namespace in other branches
- 9 core/modules/aggregator/tests/src/Kernel/ItemWithoutFeedTest.php \Drupal\Tests\aggregator\Kernel\ItemWithoutFeedTest
Tests clean handling of an item with a missing feed ID.
@group aggregator
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\AssertHelperTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\PhpunitCompatibilityTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\aggregator\Kernel\ItemWithoutFeedTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of ItemWithoutFeedTest
File
-
core/
modules/ aggregator/ tests/ src/ Kernel/ ItemWithoutFeedTest.php, line 13
Namespace
Drupal\Tests\aggregator\KernelView source
class ItemWithoutFeedTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
'aggregator',
'options',
];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installEntitySchema('aggregator_feed');
$this->installEntitySchema('aggregator_item');
}
/**
* Tests attempting to create a feed item without a feed.
*/
public function testEntityCreation() {
$entity = Item::create([
'title' => t('Llama 2'),
'path' => 'https://groups.drupal.org/',
]);
$violations = $entity->validate();
$this->assertCount(1, $violations);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.