Index: modules/page_manager/tests/src/Unit/BlockDisplayVariantTest.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules/page_manager/tests/src/Unit/BlockDisplayVariantTest.php	(date 1439486222000)
+++ modules/page_manager/tests/src/Unit/BlockDisplayVariantTest.php	(revision )
@@ -18,7 +18,7 @@
 use Drupal\Core\Utility\Token;
 use Drupal\page_manager\PageExecutable;
 use Drupal\page_manager\PageInterface;
-use Drupal\page_manager\Plugin\BlockPluginCollection;
+use Drupal\ctools\Plugin\BlockPluginCollection;
 use Drupal\page_manager\Plugin\DisplayVariant\BlockDisplayVariant;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
Index: modules/page_manager/src/Plugin/Block/EntityView.php
===================================================================
--- modules/page_manager/src/Plugin/Block/EntityView.php	(date 1439486222000)
+++ modules/page_manager/src/Plugin/Block/EntityView.php	(date 1439486222000)
@@ -1,103 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\Core\Entity\Plugin\Block\EntityView.
- */
-
-namespace Drupal\page_manager\Plugin\Block;
-
-use Drupal\Core\Block\BlockBase;
-use Drupal\Core\Entity\EntityManagerInterface;
-use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
-use Drupal\Core\Plugin\ContextAwarePluginInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
-
-/**
- * Provides a block to view a specific entity.
- *
- * @Block(
- *   id = "entity_view",
- *   deriver = "Drupal\page_manager\Plugin\Deriver\EntityViewDeriver",
- * )
- */
-class EntityView extends BlockBase implements ContextAwarePluginInterface, ContainerFactoryPluginInterface {
-
-  /**
-   * The entity manager.
-   *
-   * @var \Drupal\Core\Entity\EntityManagerInterface
-   */
-  protected $entityManager;
-
-  /**
-   * Constructs a new EntityView.
-   *
-   * @param array $configuration
-   *   A configuration array containing information about the plugin instance.
-   * @param string $plugin_id
-   *   The plugin ID for the plugin instance.
-   * @param mixed $plugin_definition
-   *   The plugin implementation definition.
-   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
-   *   The entity manager.
-   */
-  public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager) {
-    parent::__construct($configuration, $plugin_id, $plugin_definition);
-
-    $this->entityManager = $entity_manager;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
-    return new static(
-      $configuration,
-      $plugin_id,
-      $plugin_definition,
-      $container->get('entity.manager')
-    );
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function defaultConfiguration() {
-    return [
-      'view_mode' => 'default',
-    ];
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function blockForm($form, FormStateInterface $form_state) {
-    $form['view_mode'] = [
-      '#type' => 'select',
-      '#options' => $this->entityManager->getViewModeOptions($this->getDerivativeId()),
-      '#title' => $this->t('View mode'),
-      '#default_value' => $this->configuration['view_mode'],
-    ];
-    return $form;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function blockSubmit($form, FormStateInterface $form_state) {
-    $this->configuration['view_mode'] = $form_state->getValue('view_mode');
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function build() {
-    /** @var $entity \Drupal\Core\Entity\EntityInterface */
-    $entity = $this->getContextValue('entity');
-    $view_builder = $this->entityManager->getViewBuilder($entity->getEntityTypeId());
-    return $view_builder->view($entity, $this->configuration['view_mode']);
-  }
-
-}
Index: modules/page_manager/tests/src/Unit/BlockVariantTraitTest.php
===================================================================
--- modules/page_manager/tests/src/Unit/BlockVariantTraitTest.php	(date 1439486222000)
+++ modules/page_manager/tests/src/Unit/BlockVariantTraitTest.php	(date 1439486222000)
@@ -1,144 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\Tests\page_manager\Unit\BlockVariantTraitTest.
- */
-
-namespace Drupal\Tests\page_manager\Unit;
-
-use Drupal\Component\Uuid\UuidInterface;
-use Drupal\page_manager\Plugin\BlockPluginCollection;
-use Drupal\page_manager\Plugin\BlockVariantTrait;
-use Drupal\Tests\UnitTestCase;
-
-/**
- * Tests the methods of a block-based variant.
- *
- * @coversDefaultClass \Drupal\page_manager\Plugin\BlockVariantTrait
- *
- * @group PageManager
- */
-class BlockVariantTraitTest extends UnitTestCase {
-
-  /**
-   * Tests the getRegionAssignments() method.
-   *
-   * @covers ::getRegionAssignments
-   *
-   * @dataProvider providerTestGetRegionAssignments
-   */
-  public function testGetRegionAssignments($expected, $blocks = []) {
-    $block_collection = $this->prophesize(BlockPluginCollection::class);
-    $block_collection->getAllByRegion()
-      ->willReturn($blocks)
-      ->shouldBeCalled();
-
-    $display_variant = new TestBlockVariantTrait();
-    $display_variant->setBlockPluginCollection($block_collection->reveal());
-
-    $this->assertSame($expected, $display_variant->getRegionAssignments());
-  }
-
-  public function providerTestGetRegionAssignments() {
-    return [
-      [
-        [
-          'top' => [],
-          'bottom' => [],
-        ],
-      ],
-      [
-        [
-          'top' => ['foo'],
-          'bottom' => [],
-        ],
-        [
-          'top' => ['foo'],
-        ],
-      ],
-      [
-        [
-          'top' => [],
-          'bottom' => [],
-        ],
-        [
-          'invalid' => ['foo'],
-        ],
-      ],
-      [
-        [
-          'top' => [],
-          'bottom' => ['foo'],
-        ],
-        [
-          'bottom' => ['foo'],
-          'invalid' => ['bar'],
-        ],
-      ],
-    ];
-  }
-
-}
-
-class TestBlockVariantTrait {
-  use BlockVariantTrait;
-
-  /**
-   * @var array
-   */
-  protected $blockConfig = [];
-
-  /**
-   * @var \Drupal\Component\Uuid\UuidInterface
-   */
-  protected $uuidGenerator;
-
-  /**
-   * @param BlockPluginCollection $block_plugin_collection
-   *
-   * @return $this
-   */
-  public function setBlockPluginCollection(BlockPluginCollection $block_plugin_collection) {
-    $this->blockPluginCollection = $block_plugin_collection;
-    return $this;
-  }
-
-  /**
-   * @param \Drupal\Component\Uuid\UuidInterface $uuid_generator
-   *
-   * @return $this
-   */
-  public function setUuidGenerator(UuidInterface $uuid_generator) {
-    $this->uuidGenerator = $uuid_generator;
-    return $this;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function uuidGenerator() {
-    return $this->uuidGenerator;
-  }
-
-  /**
-   * Sets the block configuration.
-   *
-   * @param array $config
-   *   The block configuration.
-   *
-   * @return $this
-   */
-  public function setBlockConfig(array $config) {
-    $this->blockConfig = $config;
-    return $this;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function getBlockConfig() {
-    return $this->blockConfig;
-  }
-
-}
Index: modules/page_manager/src/Plugin/ConditionVariantInterface.php
===================================================================
--- modules/page_manager/src/Plugin/ConditionVariantInterface.php	(date 1439486222000)
+++ modules/page_manager/src/Plugin/ConditionVariantInterface.php	(date 1439486222000)
@@ -1,92 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\page_manager\Plugin\ConditionVariantInterface.
- */
-
-namespace Drupal\page_manager\Plugin;
-
-use Drupal\Core\Display\VariantInterface;
-
-/**
- * Provides an interface for variant plugins that use condition plugins.
- */
-interface ConditionVariantInterface extends VariantInterface {
-
-  /**
-   * Gets the values for all defined contexts.
-   *
-   * @return \Drupal\Component\Plugin\Context\ContextInterface[]
-   *   An array of set contexts, keyed by context name.
-   */
-  public function getContexts();
-
-  /**
-   * Returns the conditions used for determining if this variant is selected.
-   *
-   * @return \Drupal\Core\Condition\ConditionInterface[]|\Drupal\Core\Condition\ConditionPluginCollection
-   *   An array of configured condition plugins.
-   */
-  public function getSelectionConditions();
-
-  /**
-   * Removes a specific selection condition.
-   *
-   * @param string $condition_id
-   *   The selection condition ID.
-   *
-   * @return $this
-   */
-  public function removeSelectionCondition($condition_id);
-
-  /**
-   * Adds a new selection condition to the page entity.
-   *
-   * @param array $configuration
-   *   An array of configuration for the new selection condition.
-   *
-   * @return string
-   *   The selection condition ID.
-   */
-  public function addSelectionCondition(array $configuration);
-
-  /**
-   * Returns the logic used to compute selections, either 'and' or 'or'.
-   *
-   * @return string
-   *   The string 'and', or the string 'or'.
-   */
-  public function getSelectionLogic();
-
-  /**
-   * Returns the definition of the plugin implementation.
-   *
-   * @return array
-   *   The plugin definition, as returned by the discovery object used by the
-   *   plugin manager.
-   */
-  public function getPluginDefinition();
-
-  /**
-   * Sets the context values for this display variant.
-   *
-   * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
-   *   An array of contexts, keyed by context name.
-   *
-   * @return $this
-   */
-  public function setContexts(array $contexts);
-
-  /**
-   * Retrieves a specific selection condition.
-   *
-   * @param string $condition_id
-   *   The selection condition ID.
-   *
-   * @return \Drupal\Core\Condition\ConditionInterface
-   *   The selection condition object.
-   */
-  public function getSelectionCondition($condition_id);
-
-}
Index: modules/page_manager/src/Plugin/BlockVariantTrait.php
===================================================================
--- modules/page_manager/src/Plugin/BlockVariantTrait.php	(date 1439486222000)
+++ modules/page_manager/src/Plugin/BlockVariantTrait.php	(date 1439486222000)
@@ -1,120 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\page_manager\Plugin\BlockVariantTrait.
- */
-
-namespace Drupal\page_manager\Plugin;
-
-/**
- * Provides methods for \Drupal\page_manager\Plugin\BlockVariantInterface.
- */
-trait BlockVariantTrait {
-
-  /**
-   * The plugin collection that holds the block plugins.
-   *
-   * @var \Drupal\page_manager\Plugin\BlockPluginCollection
-   */
-  protected $blockPluginCollection;
-
-  /**
-   * @see \Drupal\page_manager\Plugin\BlockVariantInterface::getRegionNames()
-   */
-  public function getRegionNames() {
-    return [
-      'top' => 'Top',
-      'bottom' => 'Bottom',
-    ];
-  }
-
-  /**
-   * @see \Drupal\page_manager\Plugin\BlockVariantInterface::getBlock()
-   */
-  public function getBlock($block_id) {
-    return $this->getBlockCollection()->get($block_id);
-  }
-
-  /**
-   * @see \Drupal\page_manager\Plugin\BlockVariantInterface::addBlock()
-   */
-  public function addBlock(array $configuration) {
-    $configuration['uuid'] = $this->uuidGenerator()->generate();
-    $this->getBlockCollection()->addInstanceId($configuration['uuid'], $configuration);
-    return $configuration['uuid'];
-  }
-
-  /**
-   * @see \Drupal\page_manager\Plugin\BlockVariantInterface::removeBlock()
-   */
-  public function removeBlock($block_id) {
-    $this->getBlockCollection()->removeInstanceId($block_id);
-    return $this;
-  }
-
-  /**
-   * @see \Drupal\page_manager\Plugin\BlockVariantInterface::updateBlock()
-   */
-  public function updateBlock($block_id, array $configuration) {
-    $existing_configuration = $this->getBlock($block_id)->getConfiguration();
-    $this->getBlockCollection()->setInstanceConfiguration($block_id, $configuration + $existing_configuration);
-    return $this;
-  }
-
-  /**
-   * @see \Drupal\page_manager\Plugin\BlockVariantInterface::getRegionAssignment()
-   */
-  public function getRegionAssignment($block_id) {
-    $configuration = $this->getBlock($block_id)->getConfiguration();
-    return isset($configuration['region']) ? $configuration['region'] : NULL;
-  }
-
-  /**
-   * @see \Drupal\page_manager\Plugin\BlockVariantInterface::getRegionAssignments()
-   */
-  public function getRegionAssignments() {
-    // Build an array of the region names in the right order.
-    $empty = array_fill_keys(array_keys($this->getRegionNames()), []);
-    $full = $this->getBlockCollection()->getAllByRegion();
-    // Merge it with the actual values to maintain the ordering.
-    return array_intersect_key(array_merge($empty, $full), $empty);
-  }
-
-  /**
-   * @see \Drupal\page_manager\Plugin\BlockVariantInterface::getRegionName()
-   */
-  public function getRegionName($region) {
-    $regions = $this->getRegionNames();
-    return isset($regions[$region]) ? $regions[$region] : '';
-  }
-
-  /**
-   * Returns the block plugins used for this display variant.
-   *
-   * @return \Drupal\Core\Block\BlockPluginInterface[]|\Drupal\page_manager\Plugin\BlockPluginCollection
-   *   An array or collection of configured block plugins.
-   */
-  protected function getBlockCollection() {
-    if (!$this->blockPluginCollection) {
-      $this->blockPluginCollection = new BlockPluginCollection(\Drupal::service('plugin.manager.block'), $this->getBlockConfig());
-    }
-    return $this->blockPluginCollection;
-  }
-
-  /**
-   * Returns the UUID generator.
-   *
-   * @return \Drupal\Component\Uuid\UuidInterface
-   */
-  abstract protected function uuidGenerator();
-
-  /**
-   * Returns the configuration for stored blocks.
-   *
-   * @return array
-   *   An array of block configuration, keyed by the unique block ID.
-   */
-  abstract protected function getBlockConfig();
-
-}
Index: modules/page_manager/src/Plugin/BlockVariantInterface.php
===================================================================
--- modules/page_manager/src/Plugin/BlockVariantInterface.php	(date 1439486222000)
+++ modules/page_manager/src/Plugin/BlockVariantInterface.php	(date 1439486222000)
@@ -1,101 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\page_manager\Plugin\BlockVariantInterface.
- */
-
-namespace Drupal\page_manager\Plugin;
-
-use Drupal\Core\Display\VariantInterface;
-
-/**
- * Provides an interface for variant plugins that use block plugins.
- */
-interface BlockVariantInterface extends VariantInterface {
-
-  /**
-   * Returns the human-readable list of regions keyed by machine name.
-   *
-   * @return array
-   *   An array of human-readable region names keyed by machine name.
-   */
-  public function getRegionNames();
-
-  /**
-   * Returns the human-readable name of a specific region.
-   *
-   * @param string $region
-   *   The machine name of a region.
-   *
-   * @return string
-   *   The human-readable name of a region.
-   */
-  public function getRegionName($region);
-
-  /**
-   * Adds a block to this display variant.
-   *
-   * @param array $configuration
-   *   An array of block configuration.
-   *
-   * @return string
-   *   The block ID.
-   */
-  public function addBlock(array $configuration);
-
-  /**
-   * Returns the region a specific block is assigned to.
-   *
-   * @param string $block_id
-   *   The block ID.
-   *
-   * @return string
-   *   The machine name of the region this block is assigned to.
-   */
-  public function getRegionAssignment($block_id);
-
-  /**
-   * Returns an array of regions and their block plugins.
-   *
-   * @return array
-   *   The array is first keyed by region machine name, with the values
-   *   containing an array keyed by block ID, with block plugin instances as the
-   *   values.
-   */
-  public function getRegionAssignments();
-
-  /**
-   * Returns a specific block plugin.
-   *
-   * @param string $block_id
-   *   The block ID.
-   *
-   * @return \Drupal\Core\Block\BlockPluginInterface
-   *   The block plugin.
-   */
-  public function getBlock($block_id);
-
-  /**
-   * Updates the configuration of a specific block plugin.
-   *
-   * @param string $block_id
-   *   The block ID.
-   * @param array $configuration
-   *   The array of configuration to set.
-   *
-   * @return $this
-   */
-  public function updateBlock($block_id, array $configuration);
-
-  /**
-   * Removes a specific block from this display variant.
-   *
-   * @param string $block_id
-   *   The block ID.
-   *
-   * @return $this
-   */
-  public function removeBlock($block_id);
-
-}
Index: modules/page_manager/src/Plugin/DisplayVariant/BlockDisplayVariant.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules/page_manager/src/Plugin/DisplayVariant/BlockDisplayVariant.php	(date 1439486222000)
+++ modules/page_manager/src/Plugin/DisplayVariant/BlockDisplayVariant.php	(revision )
@@ -22,10 +22,10 @@
 use Drupal\Core\Url;
 use Drupal\Core\Utility\Token;
 use Drupal\page_manager\PageExecutableInterface;
-use Drupal\page_manager\Plugin\BlockVariantInterface;
-use Drupal\page_manager\Plugin\BlockVariantTrait;
-use Drupal\page_manager\Plugin\ConditionVariantInterface;
-use Drupal\page_manager\Plugin\ConditionVariantTrait;
+use Drupal\ctools\Plugin\BlockVariantInterface;
+use Drupal\ctools\Plugin\BlockVariantTrait;
+use Drupal\ctools\Plugin\ConditionVariantInterface;
+use Drupal\ctools\Plugin\ConditionVariantTrait;
 use Drupal\page_manager\Plugin\ContextAwareVariantInterface;
 use Drupal\page_manager\Plugin\ContextAwareVariantTrait;
 use Drupal\page_manager\Plugin\PageAwareVariantInterface;
Index: modules/page_manager/src/Plugin/ConditionVariantTrait.php
===================================================================
--- modules/page_manager/src/Plugin/ConditionVariantTrait.php	(date 1439486222000)
+++ modules/page_manager/src/Plugin/ConditionVariantTrait.php	(date 1439486222000)
@@ -1,108 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\page_manager\Plugin\ConditionVariantTrait.
- */
-
-namespace Drupal\page_manager\Plugin;
-
-use Drupal\Core\Condition\ConditionAccessResolverTrait;
-use Drupal\Core\Condition\ConditionPluginCollection;
-use Drupal\Core\Plugin\ContextAwarePluginInterface;
-
-/**
- * Provides methods for \Drupal\page_manager\Plugin\ConditionVariantInterface.
- */
-trait ConditionVariantTrait {
-
-  use ConditionAccessResolverTrait;
-
-  /**
-   * The plugin collection that holds the selection condition plugins.
-   *
-   * @var \Drupal\Component\Plugin\LazyPluginCollection
-   */
-  protected $selectionConditionCollection;
-
-  /**
-   * @see \Drupal\page_manager\Plugin\ConditionVariantInterface::getSelectionConditions()
-   */
-  public function getSelectionConditions() {
-    if (!$this->selectionConditionCollection) {
-      $this->selectionConditionCollection = new ConditionPluginCollection(\Drupal::service('plugin.manager.condition'), $this->getSelectionConfiguration());
-    }
-    return $this->selectionConditionCollection;
-  }
-
-  /**
-   * @see \Drupal\page_manager\Plugin\ConditionVariantInterface::addSelectionCondition()
-   */
-  public function addSelectionCondition(array $configuration) {
-    $configuration['uuid'] = $this->uuidGenerator()->generate();
-    $this->getSelectionConditions()->addInstanceId($configuration['uuid'], $configuration);
-    return $configuration['uuid'];
-  }
-
-  /**
-   * @see \Drupal\page_manager\Plugin\ConditionVariantInterface::getSelectionCondition()
-   */
-  public function getSelectionCondition($condition_id) {
-    return $this->getSelectionConditions()->get($condition_id);
-  }
-
-  /**
-   * @see \Drupal\page_manager\Plugin\ConditionVariantInterface::removeSelectionCondition()
-   */
-  public function removeSelectionCondition($condition_id) {
-    $this->getSelectionConditions()->removeInstanceId($condition_id);
-    return $this;
-  }
-
-  /**
-   * Determines if the selection conditions will pass given a set of contexts.
-   *
-   * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
-   *   An array of set contexts, keyed by context name.
-   *
-   * @return bool
-   *   TRUE if access is granted, FALSE otherwise.
-   */
-  protected function determineSelectionAccess(array $contexts) {
-    $conditions = $this->getSelectionConditions();
-    foreach ($conditions as $condition) {
-      if ($condition instanceof ContextAwarePluginInterface) {
-        $this->contextHandler()->applyContextMapping($condition, $contexts);
-      }
-    }
-    return $this->resolveConditions($conditions, $this->getSelectionLogic());
-  }
-
-  /**
-   * @see \Drupal\page_manager\Plugin\ConditionVariantInterface::getSelectionLogic()
-   */
-  abstract public function getSelectionLogic();
-
-  /**
-   * Returns the configuration for stored selection conditions.
-   *
-   * @return array
-   *   An array of condition configuration, keyed by the unique condition ID.
-   */
-  abstract protected function getSelectionConfiguration();
-
-  /**
-   * Returns the UUID generator.
-   *
-   * @return \Drupal\Component\Uuid\UuidInterface
-   */
-  abstract protected function uuidGenerator();
-
-  /**
-   * Returns the context handler.
-   *
-   * @return \Drupal\Core\Plugin\Context\ContextHandlerInterface
-   */
-  abstract protected function contextHandler();
-
-}
Index: modules/page_manager/tests/src/Unit/BlockPluginCollectionTest.php
===================================================================
--- modules/page_manager/tests/src/Unit/BlockPluginCollectionTest.php	(date 1439486222000)
+++ modules/page_manager/tests/src/Unit/BlockPluginCollectionTest.php	(date 1439486222000)
@@ -1,86 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\Tests\page_manager\Unit\BlockPluginCollectionTest.
- */
-
-namespace Drupal\Tests\page_manager\Unit;
-
-use Drupal\Core\Block\BlockManagerInterface;
-use Drupal\Core\Block\BlockPluginInterface;
-use Drupal\page_manager\Plugin\BlockPluginCollection;
-use Drupal\Tests\UnitTestCase;
-use Prophecy\Argument;
-
-/**
- * Tests the block plugin collection.
- *
- * @coversDefaultClass \Drupal\page_manager\Plugin\BlockPluginCollection
- *
- * @group PageManager
- */
-class BlockPluginCollectionTest extends UnitTestCase {
-
-  /**
-   * Tests the getAllByRegion() method.
-   *
-   * @covers ::getAllByRegion
-   */
-  public function testGetAllByRegion() {
-    $blocks = [
-      'foo' => [
-        'id' => 'foo',
-        'label' => 'Foo',
-        'plugin' => 'system_powered_by_block',
-        'region' => 'bottom',
-      ],
-      'bar' => [
-        'id' => 'bar',
-        'label' => 'Bar',
-        'plugin' => 'system_powered_by_block',
-        'region' => 'top',
-      ],
-      'bing' => [
-        'id' => 'bing',
-        'label' => 'Bing',
-        'plugin' => 'system_powered_by_block',
-        'region' => 'bottom',
-        'weight' => -10,
-      ],
-      'baz' => [
-        'id' => 'baz',
-        'label' => 'Baz',
-        'plugin' => 'system_powered_by_block',
-        'region' => 'bottom',
-      ],
-    ];
-    $block_manager = $this->prophesize(BlockManagerInterface::class);
-    $plugins = [];
-    foreach ($blocks as $block_id => $block) {
-      $plugin = $this->prophesize(BlockPluginInterface::class);
-      $plugin->label()->willReturn($block['label']);
-      $plugin->getConfiguration()->willReturn($block);
-      $plugins[$block_id] = $plugin->reveal();
-
-      $block_manager->createInstance($block_id, $block)
-        ->willReturn($plugin->reveal())
-        ->shouldBeCalled();
-    }
-
-
-    $block_plugin_collection = new BlockPluginCollection($block_manager->reveal(), $blocks);
-    $expected = [
-      'bottom' => [
-        'bing' => $plugins['bing'],
-        'baz' => $plugins['baz'],
-        'foo' => $plugins['foo'],
-      ],
-      'top' => [
-        'bar' => $plugins['bar'],
-      ],
-    ];
-    $this->assertSame($expected, $block_plugin_collection->getAllByRegion());
-  }
-
-}
Index: modules/page_manager/src/Plugin/BlockPluginCollection.php
===================================================================
--- modules/page_manager/src/Plugin/BlockPluginCollection.php	(date 1439486222000)
+++ modules/page_manager/src/Plugin/BlockPluginCollection.php	(date 1439486222000)
@@ -1,58 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\page_manager\Plugin\BlockPluginCollection.
- */
-
-namespace Drupal\page_manager\Plugin;
-
-use Drupal\Core\Block\BlockPluginInterface;
-use Drupal\Core\Plugin\DefaultLazyPluginCollection;
-
-/**
- * Provides a collection of block plugins.
- */
-class BlockPluginCollection extends DefaultLazyPluginCollection {
-
-  /**
-   * {@inheritdoc}
-   *
-   * @return \Drupal\Core\Block\BlockPluginInterface
-   */
-  public function &get($instance_id) {
-    return parent::get($instance_id);
-  }
-
-  /**
-   * Returns all blocks keyed by their region.
-   *
-   * @return array
-   *   An associative array keyed by region, containing an associative array of
-   *   block plugins.
-   */
-  public function getAllByRegion() {
-    $region_assignments = [];
-    foreach ($this as $block_id => $block) {
-      $configuration = $block->getConfiguration();
-      $region = isset($configuration['region']) ? $configuration['region'] : NULL;
-      $region_assignments[$region][$block_id] = $block;
-    }
-    foreach ($region_assignments as $region => $region_assignment) {
-      // @todo Determine the reason this needs error suppression.
-      @uasort($region_assignment, function (BlockPluginInterface $a, BlockPluginInterface $b) {
-        $a_config = $a->getConfiguration();
-        $a_weight = isset($a_config['weight']) ? $a_config['weight'] : 0;
-        $b_config = $b->getConfiguration();
-        $b_weight = isset($b_config['weight']) ? $b_config['weight'] : 0;
-        if ($a_weight == $b_weight) {
-          return strcmp($a->label(), $b->label());
-        }
-        return $a_weight > $b_weight ? 1 : -1;
-      });
-      $region_assignments[$region] = $region_assignment;
-    }
-    return $region_assignments;
-  }
-
-}
Index: modules/page_manager/src/Plugin/Deriver/EntityViewDeriver.php
===================================================================
--- modules/page_manager/src/Plugin/Deriver/EntityViewDeriver.php	(date 1439486222000)
+++ modules/page_manager/src/Plugin/Deriver/EntityViewDeriver.php	(date 1439486222000)
@@ -1,66 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\Core\Entity\Plugin\Derivative\EntityViewDeriver.
- */
-
-namespace Drupal\page_manager\Plugin\Deriver;
-
-use Drupal\Component\Plugin\Derivative\DeriverBase;
-use Drupal\Core\Entity\EntityManagerInterface;
-use Drupal\Core\Plugin\Context\ContextDefinition;
-use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
-use Drupal\Core\StringTranslation\StringTranslationTrait;
-use Symfony\Component\DependencyInjection\ContainerInterface;
-
-/**
- * Provides entity view block definitions for each entity type.
- */
-class EntityViewDeriver extends DeriverBase implements ContainerDeriverInterface {
-
-  use StringTranslationTrait;
-
-  /**
-   * The entity manager.
-   *
-   * @var \Drupal\Core\Entity\EntityManagerInterface
-   */
-  protected $entityManager;
-
-  /**
-   * Constructs new EntityViewDeriver.
-   *
-   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
-   *   The entity manager.
-   */
-  public function __construct(EntityManagerInterface $entity_manager) {
-    $this->entityManager = $entity_manager;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container, $base_plugin_id) {
-    return new static(
-      $container->get('entity.manager')
-    );
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function getDerivativeDefinitions($base_plugin_definition) {
-    foreach ($this->entityManager->getDefinitions() as $entity_type_id => $entity_type) {
-      if ($entity_type->hasViewBuilderClass()) {
-        $this->derivatives[$entity_type_id] = $base_plugin_definition;
-        $this->derivatives[$entity_type_id]['admin_label'] = $this->t('Entity view (@label)', ['@label' => $entity_type->getLabel()]);
-        $this->derivatives[$entity_type_id]['context'] = [
-          'entity' => new ContextDefinition('entity:' . $entity_type_id),
-        ];
-      }
-    }
-    return $this->derivatives;
-  }
-
-}
