Update to drupal-org-drupal 8.0.0-rc2. For more information, see https://www.drupal.org/node/2598668

This commit is contained in:
Pantheon Automation 2015-10-21 21:44:50 -07:00 committed by Greg Anderson
parent f32e58e4b1
commit 8e18df8c36
3062 changed files with 15044 additions and 172506 deletions

View file

@ -12,8 +12,6 @@ use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Datetime\DateFormatterInterface;
use Drupal\aggregator\FeedInterface;
use Drupal\Core\Url;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**

View file

@ -10,7 +10,6 @@ namespace Drupal\aggregator\Entity;
use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Symfony\Component\DependencyInjection\Container;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\aggregator\FeedInterface;
@ -30,7 +29,10 @@ use Drupal\aggregator\FeedInterface;
* "default" = "Drupal\aggregator\FeedForm",
* "delete" = "Drupal\aggregator\Form\FeedDeleteForm",
* "delete_items" = "Drupal\aggregator\Form\FeedItemsDeleteForm",
* }
* },
* "route_provider" = {
* "html" = "Drupal\aggregator\FeedHtmlRouteProvider",
* },
* },
* links = {
* "canonical" = "/aggregator/sources/{aggregator_feed}",

View file

@ -0,0 +1,39 @@
<?php
/**
* @file
* Contains Drupal\aggregator\FeedHtmlRouteProvider.
*/
namespace Drupal\aggregator;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\Routing\AdminHtmlRouteProvider;
/**
* Provides HTML routes for the feed entity type.
*/
class FeedHtmlRouteProvider extends AdminHtmlRouteProvider {
/**
* {@inheritdoc}
*/
protected function getCanonicalRoute(EntityTypeInterface $entity_type) {
$route = parent::getCanonicalRoute($entity_type);
$route->setDefault('_title_controller', '\Drupal\aggregator\Controller\AggregatorController::feedTitle');
return $route;
}
/**
* {@inheritdoc}
*/
protected function getEditFormRoute(EntityTypeInterface $entity_type) {
$route = parent::getEditFormRoute($entity_type);
$route->setDefault('_title', 'Configure');
return $route;
}
}

View file

@ -7,7 +7,6 @@
namespace Drupal\aggregator;
use Drupal\aggregator\FeedInterface;
use Drupal\Core\Entity\EntityStorageInterface;
/**

View file

@ -7,7 +7,6 @@
namespace Drupal\aggregator;
use Drupal\aggregator\Entity\Item;
use Drupal\Core\Entity\EntityStorageInterface;
/**

View file

@ -7,7 +7,6 @@
namespace Drupal\aggregator;
use Drupal\Core\Entity\ContentEntityTypeInterface;
use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
use Drupal\Core\Field\FieldStorageDefinitionInterface;

View file

@ -7,10 +7,8 @@
namespace Drupal\aggregator\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Plugin implementation of the 'aggregator_xss' formatter.

View file

@ -12,7 +12,6 @@ use Drupal\aggregator\Plugin\AggregatorPluginSettingsBase;
use Drupal\aggregator\Plugin\ProcessorInterface;
use Drupal\aggregator\FeedInterface;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Database\Database;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Datetime\DateFormatterInterface;
use Drupal\Core\Entity\Query\QueryInterface;

View file

@ -6,7 +6,6 @@
*/
namespace Drupal\aggregator\Tests;
use Drupal\Component\Utility\Html;
/**
* Add feed test.
@ -62,8 +61,8 @@ class AddFeedTest extends AggregatorTestBase {
$this->drupalGet('aggregator/sources/' . $feed->id());
$this->assertResponse(200);
$result = $this->xpath('//h1');
$this->assertEqual((string) $result[0], 'Test feed title alert(123);');
$this->assertEscaped('Test feed title <script>alert(123);</script>');
$this->assertNoRaw('Test feed title <script>alert(123);</script>');
// Ensure the feed icon title is escaped.
$this->assertTrue(strpos(str_replace(["\n", "\r"], '', $this->getRawContent()), 'class="feed-icon"> Subscribe to Test feed title &lt;script&gt;alert(123);&lt;/script&gt; feed</a>') !== FALSE);

View file

@ -8,7 +8,6 @@
namespace Drupal\aggregator\Tests;
use Drupal\Core\Url;
use Zend\Feed\Reader\Reader;
/**
* Tests the built-in feed parser with valid feed samples.

View file

@ -13,11 +13,14 @@ use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
/**
* Test migration to aggregator_feed entities.
*
* @group aggregator
* @group migrate_drupal_7
*/
class MigrateAggregatorFeedTest extends MigrateDrupal7TestBase {
public static $modules = array('aggregator');
/**
* {@inheritdoc}
*/
public static $modules = ['aggregator'];
/**
* {@inheritdoc}
@ -32,19 +35,25 @@ class MigrateAggregatorFeedTest extends MigrateDrupal7TestBase {
* Tests migration of aggregator feeds.
*/
public function testAggregatorFeedImport() {
/** @var \Drupal\aggregator\Entity\Feed $feed */
/** @var \Drupal\aggregator\FeedInterface $feed */
$feed = Feed::load(1);
$this->assertIdentical('Know Your Meme', $feed->title->value);
$this->assertIdentical('Know Your Meme', $feed->label());
$this->assertIdentical('en', $feed->language()->getId());
$this->assertIdentical('http://knowyourmeme.com/newsfeed.rss', $feed->url->value);
$this->assertIdentical('900', $feed->refresh->value);
$this->assertIdentical('1387659487', $feed->checked->value);
$this->assertIdentical('0', $feed->queued->value);
$this->assertIdentical('http://knowyourmeme.com/newsfeed.rss', $feed->getUrl());
$this->assertIdentical('900', $feed->getRefreshRate());
// The feed's last checked time can change as the fixture is updated, so
// assert that its format is correct.
$checked_time = $feed->getLastCheckedTime();
$this->assertTrue(is_numeric($checked_time));
$this->assertTrue($checked_time > 1000000000);
$this->assertIdentical('0', $feed->getQueuedTime());
$this->assertIdentical('http://knowyourmeme.com', $feed->link->value);
$this->assertIdentical('New items added to the News Feed', $feed->description->value);
$this->assertIdentical('http://b.thumbs.redditmedia.com/harEHsUUZVajabtC.png', $feed->image->value);
$this->assertIdentical('"213cc1365b96c310e92053c5551f0504"', $feed->etag->value);
$this->assertIdentical('0', $feed->modified->value);
$this->assertIdentical('New items added to the News Feed', $feed->getDescription());
$this->assertNull($feed->getImage());
// As with getLastCheckedTime(), the etag can change as the fixture is
// updated normally, so assert that its format is correct.
$this->assertTrue(preg_match('/^"[a-z0-9]{32}"$/', $feed->getEtag()));
$this->assertIdentical('0', $feed->getLastModified());
}
}

View file

@ -13,11 +13,14 @@ use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
/**
* Tests migration of aggregator items.
*
* @group aggregator
* @group migrate_drupal_7
*/
class MigrateAggregatorItemTest extends MigrateDrupal7TestBase {
public static $modules = array('aggregator');
/**
* {@inheritdoc}
*/
public static $modules = ['aggregator'];
/**
* {@inheritdoc}
@ -34,17 +37,27 @@ class MigrateAggregatorItemTest extends MigrateDrupal7TestBase {
* Test Drupal 7 aggregator item migration to Drupal 8.
*/
public function testAggregatorItem() {
/** @var \Drupal\aggregator\Entity\Item $item */
$item = Item::load(1);
$this->assertIdentical('1', $item->id());
$this->assertIdentical('1', $item->getFeedId());
$this->assertIdentical('This (three) weeks in Drupal Core - January 10th 2014', $item->label());
$this->assertIdentical('larowlan', $item->getAuthor());
$this->assertIdentical("<h2 id='new'>What's new with Drupal 8?</h2>", $item->getDescription());
$this->assertIdentical('https://groups.drupal.org/node/395218', $item->getLink());
$this->assertIdentical('1389297196', $item->getPostedTime());
$this->assertIdentical('en', $item->language()->getId());
$this->assertIdentical('395218 at https://groups.drupal.org', $item->getGuid());
// Since the feed items can change as the fixture is updated normally,
// assert all migrated feed items against the values in the fixture.
$items = $this->sourceDatabase
->select('aggregator_item', 'ai')
->fields('ai')
->execute();
foreach ($items as $original) {
/** @var \Drupal\aggregator\ItemInterface $item */
$item = Item::load($original->iid);
$this->assertIdentical($original->fid, $item->getFeedId());
$this->assertIdentical($original->title, $item->label());
// If $original->author is an empty string, getAuthor() returns NULL so
// we need to use assertEqual() here.
$this->assertEqual($original->author, $item->getAuthor());
$this->assertIdentical($original->description, $item->getDescription());
$this->assertIdentical($original->link, $item->getLink());
$this->assertIdentical($original->timestamp, $item->getPostedTime());
$this->assertIdentical('en', $item->language()->getId());
$this->assertIdentical($original->guid, $item->getGuid());
}
}
}