Update to Drupal 8.0.0-rc3. For more information, see https://www.drupal.org/node/2608078
This commit is contained in:
parent
6419a031d7
commit
4afb23bbd3
762 changed files with 20080 additions and 6368 deletions
core/modules/aggregator
aggregator.install
src
tests/modules/aggregator_test/src/Plugin/aggregator/fetcher
|
@ -21,3 +21,19 @@ function aggregator_requirements($phase) {
|
|||
}
|
||||
return $requirements;
|
||||
}
|
||||
|
||||
/**
|
||||
* @addtogroup updates-8.0.0-rc
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* The simple presence of this update function clears cached field definitions.
|
||||
*/
|
||||
function aggregator_update_8001() {
|
||||
// Feed ID base field is now required.
|
||||
}
|
||||
|
||||
/**
|
||||
* @} End of "addtogroup updates-8.0.0-rc".
|
||||
*/
|
||||
|
|
|
@ -53,7 +53,7 @@ use Drupal\aggregator\FeedInterface;
|
|||
class Feed extends ContentEntityBase implements FeedInterface {
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Entity\EntityInterface::label().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function label() {
|
||||
return $this->get('title')->value;
|
||||
|
|
|
@ -42,7 +42,7 @@ use Drupal\Core\Url;
|
|||
class Item extends ContentEntityBase implements ItemInterface {
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Entity\EntityInterface::label().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function label() {
|
||||
return $this->get('title')->value;
|
||||
|
@ -60,6 +60,7 @@ class Item extends ContentEntityBase implements ItemInterface {
|
|||
|
||||
$fields['fid'] = BaseFieldDefinition::create('entity_reference')
|
||||
->setLabel(t('Source feed'))
|
||||
->setRequired(TRUE)
|
||||
->setDescription(t('The aggregator feed entity associated with this item.'))
|
||||
->setSetting('target_type', 'aggregator_feed')
|
||||
->setDisplayOptions('view', array(
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains Drupal\aggregator\FeedHtmlRouteProvider.
|
||||
* Contains \Drupal\aggregator\FeedHtmlRouteProvider.
|
||||
*/
|
||||
|
||||
namespace Drupal\aggregator;
|
||||
|
|
|
@ -50,7 +50,6 @@ class Rss extends RssPluginBase {
|
|||
|
||||
$item = new \stdClass();
|
||||
foreach ($entity as $name => $field) {
|
||||
// views_view_row_rss takes care about the escaping.
|
||||
$item->{$name} = $field->value;
|
||||
}
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ abstract class AggregatorTestBase extends WebTestBase {
|
|||
public function updateFeedItems(FeedInterface $feed, $expected_count = NULL) {
|
||||
// First, let's ensure we can get to the rss xml.
|
||||
$this->drupalGet($feed->getUrl());
|
||||
$this->assertResponse(200, format_string('!url is reachable.', array('!url' => $feed->getUrl())));
|
||||
$this->assertResponse(200, format_string(':url is reachable.', array(':url' => $feed->getUrl())));
|
||||
|
||||
// Attempt to access the update link directly without an access token.
|
||||
$this->drupalGet('admin/config/services/aggregator/update/' . $feed->id());
|
||||
|
|
46
core/modules/aggregator/src/Tests/ItemWithoutFeedTest.php
Normal file
46
core/modules/aggregator/src/Tests/ItemWithoutFeedTest.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\aggregator\Tests\ItemWithoutFeedTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\aggregator\Tests;
|
||||
|
||||
use Drupal\aggregator\Entity\Item;
|
||||
use Drupal\KernelTests\KernelTestBase;
|
||||
|
||||
/**
|
||||
* Tests clean handling of an item with a missing feed ID.
|
||||
*
|
||||
* @group aggregator
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -25,7 +25,7 @@ use Drupal\aggregator\FeedInterface;
|
|||
class TestFetcher extends DefaultFetcher implements FetcherInterface {
|
||||
|
||||
/**
|
||||
* Implements \Drupal\aggregator\Plugin\FetcherInterface::fetch().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function fetch(FeedInterface $feed) {
|
||||
if ($feed->label() == 'Do not fetch') {
|
||||
|
|
Reference in a new issue