3 namespace Drupal\Tests\aggregator\Kernel;
5 use Drupal\aggregator\Entity\Item;
6 use Drupal\KernelTests\KernelTestBase;
9 * Tests clean handling of an item with a missing feed ID.
13 class ItemWithoutFeedTest extends KernelTestBase {
18 public static $modules = ['aggregator', 'options'];
23 protected function setUp() {
25 $this->installEntitySchema('aggregator_feed');
26 $this->installEntitySchema('aggregator_item');
30 * Tests attempting to create a feed item without a feed.
32 public function testEntityCreation() {
33 $entity = Item::create([
34 'title' => t('Llama 2'),
35 'path' => 'https://groups.drupal.org/',
37 $violations = $entity->validate();
38 $this->assertCount(1, $violations);