AggregatorFeedViewsFieldAccessTest.php in Drupal 9
File
core/modules/aggregator/tests/src/Kernel/Views/AggregatorFeedViewsFieldAccessTest.php
View source
<?php
namespace Drupal\Tests\aggregator\Kernel\Views;
use Drupal\aggregator\Entity\Feed;
use Drupal\Tests\views\Kernel\Handler\FieldFieldAccessTestBase;
class AggregatorFeedViewsFieldAccessTest extends FieldFieldAccessTestBase {
protected static $modules = [
'aggregator',
'entity_test',
'options',
];
protected function setUp($import_test_views = TRUE) : void {
parent::setUp($import_test_views);
$this
->installEntitySchema('aggregator_feed');
}
public function testAggregatorFeedFields() {
$feed = Feed::create([
'title' => 'Drupal org',
'url' => 'https://www.drupal.org/rss.xml',
'link' => 'https://www.drupal.org/rss.xml',
]);
$feed
->save();
$this
->assertFieldAccess('aggregator_feed', 'langcode', $feed
->language()
->getName());
$this
->assertFieldAccess('aggregator_feed', 'url', $feed
->getUrl());
}
}