ItemWithoutFeedTest.php in Zircon Profile 8.0
File
core/modules/aggregator/src/Tests/ItemWithoutFeedTest.php
View source
<?php
namespace Drupal\aggregator\Tests;
use Drupal\aggregator\Entity\Item;
use Drupal\KernelTests\KernelTestBase;
class ItemWithoutFeedTest extends KernelTestBase {
public static $modules = [
'aggregator',
'options',
];
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('aggregator_feed');
$this
->installEntitySchema('aggregator_item');
}
public function testEntityCreation() {
$entity = Item::create([
'title' => t('Llama 2'),
'path' => 'https://groups.drupal.org/',
]);
$violations = $entity
->validate();
$this
->assertCount(1, $violations);
}
}