diff --git a/core/core.services.yml b/core/core.services.yml
index 7abab67..07c0997 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -1059,3 +1059,6 @@ services:
     arguments: ['@module_handler']
     tags:
       - { name: mime_type_guesser }
+  plugin.manager.entity.display_component_handler:
+    class: Drupal\Core\Entity\DisplayComponentHandlerPluginManager
+    parent: default_plugin_manager
diff --git a/core/lib/Drupal/Core/Entity/Annotation/DisplayComponent.php b/core/lib/Drupal/Core/Entity/Annotation/DisplayComponent.php
new file mode 100644
index 0000000..e2178c2
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/Annotation/DisplayComponent.php
@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\Annotation\DisplayComponent.
+ */
+
+namespace Drupal\Core\Entity\Annotation;
+
+use Drupal\Component\Annotation\Plugin;
+
+/**
+ * Defines a DisplayComponent annotation object.
+ *
+ * @Annotation
+ */
+class DisplayComponent extends Plugin {
+
+  /**
+   * The plugin ID.
+   *
+   * @var string
+   */
+  public $id;
+
+}
diff --git a/core/lib/Drupal/Core/Entity/DisplayComponentHandlerBase.php b/core/lib/Drupal/Core/Entity/DisplayComponentHandlerBase.php
new file mode 100644
index 0000000..a31d9e6
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/DisplayComponentHandlerBase.php
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\DisplayComponentHandlerBase.
+ */
+
+namespace Drupal\Core\Entity;
+
+use Drupal\Component\Plugin\PluginBase;
+
+/**
+ * Provides a base class for DisplayComponentHandler plugins.
+ */
+abstract class DisplayComponentHandlerBase extends PluginBase implements DisplayComponentHandlerInterface {
+
+  /**
+   * The context in which the handler is being used.
+   *
+   * @var array
+   */
+  protected $context;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setContext(array $context) {
+    $this->context = $context;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function prepareDisplayComponents(array &$components, array &$hidden_components) {
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function hasElement($name) {
+    return FALSE;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function massageIn($name, array $options) {
+    return $options;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function massageOut($properties) {
+    return $properties;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getRenderer($name, array $options) {
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Entity/DisplayComponentHandlerInterface.php b/core/lib/Drupal/Core/Entity/DisplayComponentHandlerInterface.php
new file mode 100644
index 0000000..675fe98
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/DisplayComponentHandlerInterface.php
@@ -0,0 +1,88 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\DisplayComponentHandlerInterface.
+ */
+
+namespace Drupal\Core\Entity;
+
+/**
+ * Provides a base class for DisplayComponent plugins.
+ */
+interface DisplayComponentHandlerInterface {
+
+  /**
+   * Checks if the component handler has the passed element.
+   *
+   * @param string $name
+   *   The name of a display component.
+   *
+   * @return bool
+   *   TRUE if the display component handler provides the component.
+   */
+  public function hasElement($name);
+
+  /**
+   * Prepares the element options before set them to storage.
+   *
+   * @param string $name
+   *   The name of a display component.
+   * @param array $options
+   *   The default options for this component.
+   *
+   * @return array
+   *   Massaged component options.
+   */
+  public function massageIn($name, array $options);
+
+  /**
+   * Sets the context for the rendering component.
+   *
+   * @param array $context
+   *   A keyed array containing the current entity display context. The
+   *   following parameters should be set:
+   *   - entity_type: The type of entity.
+   *   - bundle: The entity bundle.
+   *   - view_mode: The entity view mode (default, full).
+   *   - display_context: The type of the display to use (view or form).
+   */
+  public function setContext(array $context);
+
+  /**
+   * Returns the render plugin for the display component.
+   *
+   * @param string $name
+   *   The name of a display component.
+   * @param array $options
+   *   An array of configuration options to instantiate render plugin.
+   *
+   * @return mixed
+   *   The object to render component or null.
+   */
+  public function getRenderer($name, array $options);
+
+  /**
+   * Prepares components when display created.
+   *
+   * @param array $components
+   *   A visible display components.
+   * @param array $hidden_components
+   *   A hidden display components.
+   */
+  public function prepareDisplayComponents(array &$components, array &$hidden_components);
+
+  /**
+   * Prepares the display options after they retrieved from storage.
+   *
+   * @param array $properties
+   *   The entity display properties.
+   *
+   * return @array
+   *   An associative array of the display components with following keys:
+   *   - content: Configured components to render.
+   *   - hidden: Configured components to hide from render.
+   */
+  public function massageOut($properties);
+
+}
diff --git a/core/lib/Drupal/Core/Entity/DisplayComponentHandlerPluginManager.php b/core/lib/Drupal/Core/Entity/DisplayComponentHandlerPluginManager.php
new file mode 100644
index 0000000..87616d8
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/DisplayComponentHandlerPluginManager.php
@@ -0,0 +1,62 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\DisplayComponentHandlerPluginManager.
+ */
+
+namespace Drupal\Core\Entity;
+
+use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Plugin\DefaultPluginManager;
+
+/**
+ * Manages entity display component handlers.
+ *
+ * The handlers are typically shared for the whole request. getInstance() holds
+ * the instantiated plugins and only instantiates one of each type.
+ *
+ * @see hook_display_component_handler_info_alter()
+ */
+class DisplayComponentHandlerPluginManager extends DefaultPluginManager {
+
+  /**
+   * The handlers that have already been instantiated by getInstance().
+   *
+   * @var array
+   */
+  protected $plugins = array();
+
+  /**
+   * Constructs a DisplayComponentHandlerPluginManager object.
+   *
+   * @param \Traversable $namespaces
+   *   An object that implements \Traversable which contains the root paths
+   *   keyed by the corresponding namespace to look for plugin implementations.
+   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
+   *   Cache backend instance to use.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
+   *   The module handler to invoke the alter hook with.
+   */
+  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
+    parent::__construct('Plugin/DisplayComponent', $namespaces, $module_handler, 'Drupal\Core\Entity\DisplayComponentHandlerInterface' , 'Drupal\Core\Entity\Annotation\DisplayComponent');
+    // @todo Document the alter hook.
+    $this->alterInfo('display_component_handler_info');
+    $this->setCacheBackend($cache_backend, 'display_component_handlers');
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getInstance(array $options) {
+    $plugin_id = $options['type'];
+
+    if (!isset($this->plugins[$plugin_id]) && !array_key_exists($plugin_id, $this->plugins)) {
+      $this->plugins[$plugin_id] = $this->discovery->getDefinition($plugin_id) ? $this->createInstance($plugin_id) : NULL;
+    }
+
+    return $this->plugins[$plugin_id];
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
index 6339c18..cd48873 100644
--- a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
+++ b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
@@ -121,33 +121,6 @@ public function __construct(array $values, $entity_type) {
   /**
    * {@inheritdoc}
    */
-  public function getRenderer($field_name) {
-    if (isset($this->plugins[$field_name])) {
-      return $this->plugins[$field_name];
-    }
-
-    // Instantiate the widget object from the stored display properties.
-    if (($configuration = $this->getComponent($field_name)) && isset($configuration['type']) && ($definition = $this->getFieldDefinition($field_name))) {
-      $widget = $this->pluginManager->getInstance(array(
-        'field_definition' => $definition,
-        'form_mode' => $this->originalMode,
-        // No need to prepare, defaults have been merged in setComponent().
-        'prepare' => FALSE,
-        'configuration' => $configuration
-      ));
-    }
-    else {
-      $widget = NULL;
-    }
-
-    // Persist the widget object.
-    $this->plugins[$field_name] = $widget;
-    return $widget;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
   public function buildForm(ContentEntityInterface $entity, array &$form, FormStateInterface $form_state) {
     // Set #parents to 'top-level' by default.
     $form += array('#parents' => array());
diff --git a/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php b/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php
index 57041e9..0e2689c 100644
--- a/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php
+++ b/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php
@@ -169,33 +169,6 @@ public function __construct(array $values, $entity_type) {
   /**
    * {@inheritdoc}
    */
-  public function getRenderer($field_name) {
-    if (isset($this->plugins[$field_name])) {
-      return $this->plugins[$field_name];
-    }
-
-    // Instantiate the formatter object from the stored display properties.
-    if (($configuration = $this->getComponent($field_name)) && isset($configuration['type']) && ($definition = $this->getFieldDefinition($field_name))) {
-      $formatter = $this->pluginManager->getInstance(array(
-        'field_definition' => $definition,
-        'view_mode' => $this->originalMode,
-        // No need to prepare, defaults have been merged in setComponent().
-        'prepare' => FALSE,
-        'configuration' => $configuration
-      ));
-    }
-    else {
-      $formatter = NULL;
-    }
-
-    // Persist the formatter object.
-    $this->plugins[$field_name] = $formatter;
-    return $formatter;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
   public function build(ContentEntityInterface $entity) {
     $build = $this->buildMultiple(array($entity));
     return $build[0];
diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
index c57b3a6..c694a89 100644
--- a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
@@ -79,6 +79,11 @@
   protected $hidden = array();
 
   /**
+   * The renderer objects used for this display, keyed by component name.
+   */
+  protected $renderers = array();
+
+  /**
    * The original view or form mode that was requested (case of view/form modes
    * being configured to fall back to the 'default' display).
    *
@@ -108,6 +113,18 @@
   protected $pluginManager;
 
   /**
+   * A mapping of display elements and its corresponding handler.
+   */
+  protected $handlers;
+
+  /**
+   * The display component handler plugin manager.
+   *
+   * @var \Drupal\Core\Entity\DisplayComponentHandlerPluginManager
+   */
+  protected $handlerManager;
+
+  /**
    * {@inheritdoc}
    */
   public function __construct(array $values, $entity_type) {
@@ -129,6 +146,8 @@ public function __construct(array $values, $entity_type) {
 
     parent::__construct($values, $entity_type);
 
+    $this->handlerManager = \Drupal::service('plugin.manager.entity.display_component_handler');
+
     $this->originalMode = $this->mode;
 
     $this->init();
@@ -209,14 +228,30 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) {
    * {@inheritdoc}
    */
   public function toArray() {
-    $properties = parent::toArray();
-    // Do not store options for fields whose display is not set to be
-    // configurable.
-    foreach ($this->getFieldDefinitions() as $field_name => $definition) {
-      if (!$definition->isDisplayConfigurable($this->displayContext)) {
-        unset($properties['content'][$field_name]);
-        unset($properties['hidden'][$field_name]);
-      }
+    $names = array(
+      'uuid',
+      'targetEntityType',
+      'bundle',
+      'mode',
+      'content',
+      'hidden',
+      'status',
+      'dependencies'
+    );
+    $properties = array(
+      'id' => $this->id(),
+    );
+    foreach ($names as $name) {
+      $properties[$name] = $this->get($name);
+    }
+
+    // Let the component handlers add missing components.
+    if (!$this->handlerManager) {
+      $this->handlerManager = \Drupal::service('plugin.manager.entity.display_component_handler');
+    }
+    $handlers = $this->handlerManager->getDefinitions();
+    foreach (array_keys($handlers) as $type) {
+      $properties = $this->getComponentHandler($type)->massageOut($properties);
     }
 
     return $properties;
@@ -231,40 +266,10 @@ public function toArray() {
    * - or that are not supposed to be configurable.
    */
   protected function init() {
-    // Fill in defaults for extra fields.
-    $context = $this->displayContext == 'view' ? 'display' : $this->displayContext;
-    $extra_fields = \Drupal::entityManager()->getExtraFields($this->targetEntityType, $this->bundle);
-    $extra_fields = isset($extra_fields[$context]) ? $extra_fields[$context] : array();
-    foreach ($extra_fields as $name => $definition) {
-      if (!isset($this->content[$name]) && !isset($this->hidden[$name])) {
-        // Extra fields are visible by default unless they explicitly say so.
-        if (!isset($definition['visible']) || $definition['visible'] == TRUE) {
-          $this->content[$name] = array(
-            'weight' => $definition['weight']
-          );
-        }
-        else {
-          $this->hidden[$name] = TRUE;
-        }
-      }
-    }
-
-    // Fill in defaults for fields.
-    $fields = $this->getFieldDefinitions();
-    foreach ($fields as $name => $definition) {
-      if (!$definition->isDisplayConfigurable($this->displayContext) || (!isset($this->content[$name]) && !isset($this->hidden[$name]))) {
-        $options = $definition->getDisplayOptions($this->displayContext);
-
-        if (!empty($options['type']) && $options['type'] == 'hidden') {
-          $this->hidden[$name] = TRUE;
-        }
-        elseif ($options) {
-          $this->content[$name] = $this->pluginManager->prepareConfiguration($definition->getType(), $options);
-        }
-        // Note: (base) fields that do not specify display options are not
-        // tracked in the display at all, in order to avoid cluttering the
-        // configuration that gets saved back.
-      }
+    // Let the component handlers add missing components.
+    $handlers = $this->handlerManager->getDefinitions();
+    foreach (array_keys($handlers) as $type) {
+      $this->getComponentHandler($type)->prepareDisplayComponents($this->content, $this->hidden);
     }
   }
 
@@ -301,14 +306,16 @@ public function setComponent($name, array $options = array()) {
       $options['weight'] = isset($max) ? $max + 1 : 0;
     }
 
-    // For a field, fill in default options.
-    if ($field_definition = $this->getFieldDefinition($name)) {
-      $options = $this->pluginManager->prepareConfiguration($field_definition->getType(), $options);
+    // Massage in some values.
+    $handler = $this->getComponentHandlerByElementName($name);
+    if ($handler) {
+      // @todo sometimes handler not found.
+      $options = $handler->massageIn($name, $options);
     }
 
     $this->content[$name] = $options;
     unset($this->hidden[$name]);
-    unset($this->plugins[$name]);
+    unset($this->renderers[$name]);
 
     return $this;
   }
@@ -410,4 +417,69 @@ public function onDependencyRemoval(array $dependencies) {
     }
   }
 
+  /**
+   * Finds component handler by element name.
+   *
+   * @param string $name
+   *   The element name.
+   *
+   * @return \Drupal\Core\Entity\DisplayComponentHandlerInterface
+   */
+  public function getComponentHandlerByElementName($name) {
+    if (!isset($this->handlers[$name])) {
+      $handlers = $this->handlerManager->getDefinitions();
+      foreach (array_keys($handlers) as $type) {
+        $handler = $this->getComponentHandler($type);
+        if ($handler && $handler->hasElement($name)) {
+          break;
+        }
+        $handler = NULL;
+      }
+      $this->handlers[$name] = $handler;
+    }
+
+    return $this->handlers[$name];
+  }
+
+  /**
+   * Instantiates component handler.
+   *
+   * @param string $type
+   *   The type of component handler (field, extra_field).
+   *
+   * @return \Drupal\Core\Entity\DisplayComponentHandlerInterface
+   */
+  public function getComponentHandler($type) {
+    $handler = $this->handlerManager->getInstance(array('type' => $type));
+    if ($handler) {
+      $handler->setContext(array(
+        'entity_type' => $this->targetEntityType,
+        'bundle' => $this->bundle,
+        'mode' => $this->originalMode,
+        'display_context' => $this->displayContext,
+      ));
+    }
+    return $handler;
+  }
+
+  /**+
+   * {@inheritdoc}
+   */
+  public function getRenderer($name) {
+    if (!isset($this->content[$name])) {
+      return NULL;
+    }
+
+    if (!array_key_exists($name, $this->renderers)) {
+      if ($handler = $this->getComponentHandlerByElementName($name)) {
+        $options = $this->getComponent($name);
+        $this->renderers[$name] = $handler->getRenderer($name, $options);
+      }
+      else {
+        $this->renderers[$name] = NULL;
+      }
+    }
+    return $this->renderers[$name];
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Entity/Plugin/DisplayComponent/ExtraFieldDisplayComponentHandler b/core/lib/Drupal/Core/Entity/Plugin/DisplayComponent/ExtraFieldDisplayComponentHandler
new file mode 100644
index 0000000..17a092c
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/Plugin/DisplayComponent/ExtraFieldDisplayComponentHandler
@@ -0,0 +1,50 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\Plugin\DisplayComponent\ExtraFieldDisplayComponentHandler.
+ */
+
+namespace Drupal\Core\Entity\Plugin\DisplayComponent;
+
+use Drupal\Core\Entity\DisplayComponentHandlerBase;
+
+/**
+ * Provides a component handler to manage entity extra fields.
+ *
+ * @DisplayComponent(
+ *   id = "extra_field"
+ * )
+ */
+class ExtraFieldDisplayComponentHandler extends DisplayComponentHandlerBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function prepareDisplayComponents(array &$components, array &$hidden_components) {
+    // Fill in defaults for extra fields.
+    $extra_fields = \Drupal::entityManager()->getExtraFields($this->context['entity_type'], $this->context['bundle'], ($this->context['display_context'] == 'view' ? 'display' : $this->context['display_context']));
+    foreach ($extra_fields as $name => $definition) {
+      if (!isset($components[$name]) && !isset($hidden_components[$name])) {
+        // Extra fields are visible by default unless they explicitly say so.
+        if (!isset($definition['visible']) || $definition['visible'] == TRUE) {
+          $components[$name] = array(
+            'weight' => $definition['weight']
+          );
+        }
+        else {
+          $hidden_components[$name] = TRUE;
+        }
+      }
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function hasElement($name) {
+    $extra_fields = \Drupal::entityManager()->getExtraFields($this->context['entity_type'], $this->context['bundle'], ($this->context['display_context'] == 'view' ? 'display' : $this->context['display_context']));
+    return isset($extra_fields[$name]);
+  }
+
+}
diff --git a/core/modules/field/src/Plugin/DisplayComponent/FieldDisplayComponentHandler.php b/core/modules/field/src/Plugin/DisplayComponent/FieldDisplayComponentHandler.php
new file mode 100644
index 0000000..b1f9b89
--- /dev/null
+++ b/core/modules/field/src/Plugin/DisplayComponent/FieldDisplayComponentHandler.php
@@ -0,0 +1,205 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\field\Plugin\DisplayComponent\FieldDisplayComponentHandler.
+ */
+
+namespace Drupal\field\Plugin\DisplayComponent;
+
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FormatterPluginManager;
+use Drupal\Core\Field\WidgetPluginManager;
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
+use Drupal\Core\Entity\DisplayComponentHandlerBase;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Provides a component handler to manage entity fields.
+ *
+ * @DisplayComponent(
+ *   id = "field"
+ * )
+ */
+class FieldDisplayComponentHandler extends DisplayComponentHandlerBase implements ContainerFactoryPluginInterface {
+
+  /**
+   * The field formatter plugin manager.
+   *
+   * @var \Drupal\Core\Field\FormatterPluginManager
+   */
+  protected $formatterPluginManager;
+
+  /**
+   * The field widget plugin manager.
+   *
+   * @var \Drupal\Core\Field\WidgetPluginManager
+   */
+  protected $widgetPluginManager;
+
+  /**
+   * A list of field definitions eligible for configuration in this display.
+   *
+   * @var \Drupal\Core\Field\FieldDefinitionInterface[]
+   */
+  protected $fieldDefinitions;
+
+  /**
+   * Constructs a FieldDisplayComponentHandler object.
+   *
+   * @param array $configuration
+   *   A configuration array containing information about the plugin instance.
+   * @param string $plugin_id
+   *   The plugin ID for the plugin instance.
+   * @param array $plugin_definition
+   *   The plugin implementation definition.
+   * @param \Drupal\Core\Field\FormatterPluginManager $formatter_plugin_manager
+   *   The field formatter plugin manager.
+   * @param \Drupal\Core\Field\WidgetPluginManager $widget_plugin_manager
+   *   The field widget plugin manager.
+   */
+  public function __construct(array $configuration, $plugin_id, array $plugin_definition, FormatterPluginManager $formatter_plugin_manager, WidgetPluginManager $widget_plugin_manager) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+
+    $this->formatterPluginManager = $formatter_plugin_manager;
+    $this->widgetPluginManager = $widget_plugin_manager;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static($configuration, $plugin_id, $plugin_definition,
+      $container->get('plugin.manager.field.formatter'),
+      $container->get('plugin.manager.field.widget')
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function massageIn($name, array $options) {
+    $field_definition = $this->getFieldDefinition($name);
+    if (!isset($field_definition)) {
+      // The field in process of removal from display.
+      return $options;
+    }
+    if ($this->context['display_context'] == 'view') {
+      return $this->formatterPluginManager->prepareConfiguration($field_definition->getType(), $options);
+    }
+    else {
+      return $this->widgetPluginManager->prepareConfiguration($field_definition->getType(), $options);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function massageOut($properties) {
+    // Do not store options for fields whose display is not set to be
+    // configurable.
+    foreach ($this->getFieldDefinitions() as $field_name => $definition) {
+      if (!$definition->isDisplayConfigurable($this->context['display_context'])) {
+        unset($properties['content'][$field_name]);
+        unset($properties['hidden'][$field_name]);
+      }
+    }
+
+    return $properties;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function prepareDisplayComponents(array &$components, array &$hidden_components) {
+    if ($this->context['display_context'] == 'view') {
+      $plugin_manager = $this->formatterPluginManager;
+    }
+    else {
+      $plugin_manager = $this->widgetPluginManager;
+    }
+
+    // Fill in defaults for fields.
+    $fields = $this->getFieldDefinitions();
+    foreach ($fields as $name => $definition) {
+      if (!$definition->isDisplayConfigurable($this->context['display_context']) || (!isset($components[$name]) && !isset($hidden_components[$name]))) {
+        $options = $definition->getDisplayOptions($this->context['display_context']);
+
+        if (!empty($options['type']) && $options['type'] == 'hidden') {
+          $hidden_components[$name] = TRUE;
+        }
+        elseif ($options) {
+          $components[$name] = $plugin_manager->prepareConfiguration($definition->getType(), $options);
+        }
+        // Note: (base) fields that do not specify display options are not
+        // tracked in the display at all, in order to avoid cluttering the
+        // configuration that gets saved back.
+      }
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getRenderer($name, array $options) {
+    if (isset($options['type']) && ($definition = $this->getFieldDefinition($name))) {
+      if ($this->context['display_context'] == 'view') {
+        $plugin_manager = $this->formatterPluginManager;
+        $mode_key = 'view_mode';
+      }
+      else {
+        $plugin_manager = $this->widgetPluginManager;
+        $mode_key = 'form_mode';
+      }
+
+      return $plugin_manager->getInstance(array(
+        'field_definition' => $definition,
+        $mode_key => $this->context['mode'],
+        // No need to prepare, defaults have been merged when the options were
+        // written in the display.
+        'prepare' => FALSE,
+        'configuration' => $options,
+      ));
+    }
+    return NULL;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function hasElement($name) {
+    $field_defintion = $this->getFieldDefinition($name);
+    return isset($field_defintion);
+  }
+
+  /**
+   * Returns the field definition of a field.
+   */
+  protected function getFieldDefinition($field_name) {
+    $definitions = $this->getFieldDefinitions();
+    return isset($definitions[$field_name]) ? $definitions[$field_name] : NULL;
+  }
+
+  /**
+   * Returns the definitions of the fields that are candidate for display.
+   */
+  protected function getFieldDefinitions() {
+    $entity_manager = \Drupal::entityManager();
+
+    $entity_type = $this->context['entity_type'];
+    $bundle = $this->context['bundle'];
+    if (!isset($this->fieldDefinitions[$entity_type . ':' . $bundle])) {
+      $definitions = $entity_manager->getFieldDefinitions($this->context['entity_type'], $this->context['bundle']);
+
+      // The display only cares about fields that specify display options.
+      // Discard base fields that are not rendered through formatters / widgets.
+      $display_context = $this->context['display_context'];
+      $this->fieldDefinitions[$entity_type . ':' . $bundle] = array_filter($definitions, function (FieldDefinitionInterface $definition) use ($display_context) {
+        return $definition->getDisplayOptions($display_context);
+      });
+   }
+
+    return $this->fieldDefinitions[$entity_type . ':' . $bundle];
+  }
+
+}
diff --git a/core/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/UtilTest.php b/core/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/UtilTest.php
deleted file mode 100644
index e3d8f9f..0000000
--- a/core/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/UtilTest.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-/**
- * PHP_CodeCoverage
- *
- * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- *   * Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *
- *   * Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in
- *     the documentation and/or other materials provided with the
- *     distribution.
- *
- *   * Neither the name of Sebastian Bergmann nor the names of his
- *     contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @category   PHP
- * @package    CodeCoverage
- * @subpackage Tests
- * @author     Sebastian Bergmann <sebastian@phpunit.de>
- * @copyright  2009-2014 Sebastian Bergmann <sebastian@phpunit.de>
- * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
- * @link       http://github.com/sebastianbergmann/php-code-coverage
- * @since      File available since Release 1.0.0
- */
-
-/**
- * Tests for the PHP_CodeCoverage_Util class.
- *
- * @category   PHP
- * @package    CodeCoverage
- * @subpackage Tests
- * @author     Sebastian Bergmann <sebastian@phpunit.de>
- * @copyright  2009-2014 Sebastian Bergmann <sebastian@phpunit.de>
- * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
- * @link       http://github.com/sebastianbergmann/php-code-coverage
- * @since      Class available since Release 1.0.0
- */
-class PHP_CodeCoverage_UtilTest extends PHPUnit_Framework_TestCase
-{
-    /**
-     * @covers PHP_CodeCoverage_Util::percent
-     */
-    public function testPercent()
-    {
-        $this->assertEquals(100, PHP_CodeCoverage_Util::percent(100, 0));
-        $this->assertEquals(100, PHP_CodeCoverage_Util::percent(100, 100));
-        $this->assertEquals(
-          '100.00%', PHP_CodeCoverage_Util::percent(100, 100, true)
-        );
-    }
-}
diff --git a/core/vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesWhitespaceTest.php b/core/vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesWhitespaceTest.php
deleted file mode 100644
index becc6c8..0000000
--- a/core/vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesWhitespaceTest.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-class CoverageFunctionParenthesesWhitespaceTest extends PHPUnit_Framework_TestCase
-{
-    /**
-     * @covers ::globalFunction ( )
-     */
-    public function testSomething()
-    {
-        globalFunction();
-    }
-}
diff --git a/core/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodOneLineAnnotationTest.php b/core/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodOneLineAnnotationTest.php
deleted file mode 100644
index 55d7f57..0000000
--- a/core/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodOneLineAnnotationTest.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-class CoverageMethodOneLineAnnotationTest extends PHPUnit_Framework_TestCase
-{
-    /** @covers CoveredClass::publicMethod */
-    public function testSomething()
-    {
-        $o = new CoveredClass;
-        $o->publicMethod();
-    }
-}
diff --git a/core/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesWhitespaceTest.php b/core/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesWhitespaceTest.php
deleted file mode 100644
index d1be1c6..0000000
--- a/core/vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesWhitespaceTest.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-class CoverageMethodParenthesesWhitespaceTest extends PHPUnit_Framework_TestCase
-{
-    /**
-     * @covers CoveredClass::publicMethod ( )
-     */
-    public function testSomething()
-    {
-        $o = new CoveredClass;
-        $o->publicMethod();
-    }
-}
diff --git a/core/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassPublicTest.php b/core/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassPublicTest.php
deleted file mode 100644
index 45f583b..0000000
--- a/core/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassPublicTest.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-/**
- * @coversDefaultClass \Foo\CoveredClass
- */
-class NamespaceCoverageCoversClassPublicTest extends PHPUnit_Framework_TestCase
-{
-    /**
-     * @covers ::publicMethod
-     */
-    public function testSomething()
-    {
-        $o = new Foo\CoveredClass;
-        $o->publicMethod();
-    }
-}
diff --git a/core/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassTest.php b/core/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassTest.php
deleted file mode 100644
index b336745..0000000
--- a/core/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassTest.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/**
- * @coversDefaultClass \Foo\CoveredClass
- */
-class NamespaceCoverageCoversClassTest extends PHPUnit_Framework_TestCase
-{
-    /**
-     * @covers ::privateMethod
-     * @covers ::protectedMethod
-     * @covers ::publicMethod
-     * @covers \Foo\CoveredParentClass::privateMethod
-     * @covers \Foo\CoveredParentClass::protectedMethod
-     * @covers \Foo\CoveredParentClass::publicMethod
-     */
-    public function testSomething()
-    {
-        $o = new Foo\CoveredClass;
-        $o->publicMethod();
-    }
-}
diff --git a/core/vendor/phpunit/phpunit-mock-objects/tests/GeneratorTest.php b/core/vendor/phpunit/phpunit-mock-objects/tests/GeneratorTest.php
deleted file mode 100644
index 6663ab4..0000000
--- a/core/vendor/phpunit/phpunit-mock-objects/tests/GeneratorTest.php
+++ /dev/null
@@ -1,142 +0,0 @@
-<?php
-class Framework_MockObject_GeneratorTest extends PHPUnit_Framework_TestCase
-{
-    protected $generator;
-
-    protected function setUp()
-    {
-        $this->generator = new PHPUnit_Framework_MockObject_Generator;
-    }
-
-    /**
-     * @covers PHPUnit_Framework_MockObject_Generator::getMock
-     * @expectedException PHPUnit_Framework_Exception
-     */
-    public function testGetMockFailsWhenInvalidFunctionNameIsPassedInAsAFunctionToMock()
-    {
-        $this->generator->getMock('StdClass', array(0));
-    }
-
-    /**
-     * @covers PHPUnit_Framework_MockObject_Generator::getMock
-     */
-    public function testGetMockCanCreateNonExistingFunctions()
-    {
-        $mock = $this->generator->getMock('StdClass', array('testFunction'));
-        $this->assertTrue(method_exists($mock, 'testFunction'));
-    }
-
-    /**
-     * @covers PHPUnit_Framework_MockObject_Generator::getMock
-     * @expectedException PHPUnit_Framework_MockObject_RuntimeException
-     * @expectedExceptionMessage duplicates: "foo, foo"
-     */
-    public function testGetMockGeneratorFails()
-    {
-        $mock = $this->generator->getMock('StdClass', array('foo', 'foo'));
-    }
-
-    /**
-     * @covers PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass
-     */
-    public function testGetMockForAbstractClassDoesNotFailWhenFakingInterfaces()
-    {
-        $mock = $this->generator->getMockForAbstractClass('Countable');
-        $this->assertTrue(method_exists($mock, 'count'));
-    }
-
-    /**
-     * @covers PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass
-     */
-    public function testGetMockForAbstractClassStubbingAbstractClass()
-    {
-        $mock = $this->generator->getMockForAbstractClass('AbstractMockTestClass');
-        $this->assertTrue(method_exists($mock, 'doSomething'));
-    }
-
-    /**
-     * @covers PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass
-     */
-    public function testGetMockForAbstractClassWithNonExistentMethods()
-    {
-        $mock = $this->generator->getMockForAbstractClass(
-            'AbstractMockTestClass', array(), '',  true,
-            true, true, array('nonexistentMethod')
-        );
-
-        $this->assertTrue(method_exists($mock, 'nonexistentMethod'));
-        $this->assertTrue(method_exists($mock, 'doSomething'));
-    }
-
-    /**
-     * @covers PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass
-     */
-    public function testGetMockForAbstractClassShouldCreateStubsOnlyForAbstractMethodWhenNoMethodsWereInformed()
-    {
-        $mock = $this->generator->getMockForAbstractClass('AbstractMockTestClass');
-
-        $mock->expects($this->any())
-             ->method('doSomething')
-             ->willReturn('testing');
-
-        $this->assertEquals('testing', $mock->doSomething());
-        $this->assertEquals(1, $mock->returnAnything());
-    }
-
-    /**
-     * @dataProvider getMockForAbstractClassExpectsInvalidArgumentExceptionDataprovider
-     * @covers PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass
-     * @expectedException PHPUnit_Framework_Exception
-     */
-    public function testGetMockForAbstractClassExpectingInvalidArgumentException($className, $mockClassName)
-    {
-        $mock = $this->generator->getMockForAbstractClass($className, array(), $mockClassName);
-    }
-
-    /**
-     * @covers PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass
-     * @expectedException PHPUnit_Framework_MockObject_RuntimeException
-     */
-    public function testGetMockForAbstractClassAnstractClassDoesNotExist()
-    {
-        $mock = $this->generator->getMockForAbstractClass('Tux');
-    }
-
-    /**
-     * Dataprovider for test "testGetMockForAbstractClassExpectingInvalidArgumentException"
-     */
-    public static function getMockForAbstractClassExpectsInvalidArgumentExceptionDataprovider()
-    {
-        return array(
-            'className not a string' => array(array(), ''),
-            'mockClassName not a string' => array('Countable', new StdClass),
-        );
-    }
-
-    /**
-     * @covers PHPUnit_Framework_MockObject_Generator::getMockForTrait
-     * @requires PHP 5.4.0
-     */
-    public function testGetMockForTraitWithNonExistentMethodsAndNonAbstractMethods()
-    {
-        $mock = $this->generator->getMockForTrait(
-            'AbstractTrait', array(), '',  true,
-            true, true, array('nonexistentMethod')
-        );
-
-        $this->assertTrue(method_exists($mock, 'nonexistentMethod'));
-        $this->assertTrue(method_exists($mock, 'doSomething'));
-        $this->assertTrue($mock->mockableMethod());
-        $this->assertTrue($mock->anotherMockableMethod());
-    }
-
-    /**
-     * @covers   PHPUnit_Framework_MockObject_Generator::getMockForTrait
-     * @requires PHP 5.4.0
-     */
-    public function testGetMockForTraitStubbingAbstractMethod()
-    {
-        $mock = $this->generator->getMockForTrait('AbstractTrait');
-        $this->assertTrue(method_exists($mock, 'doSomething'));
-    }
-}
diff --git a/core/vendor/phpunit/phpunit-mock-objects/tests/MockObject/nonexistent_class.phpt b/core/vendor/phpunit/phpunit-mock-objects/tests/MockObject/nonexistent_class.phpt
deleted file mode 100644
index 5dbb385..0000000
--- a/core/vendor/phpunit/phpunit-mock-objects/tests/MockObject/nonexistent_class.phpt
+++ /dev/null
@@ -1,70 +0,0 @@
---TEST--
-PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE)
---FILE--
-<?php
-require __DIR__ . '/../../vendor/autoload.php';
-
-$generator = new PHPUnit_Framework_MockObject_Generator;
-
-$mock = $generator->generate(
-  'Foo',
-  array(),
-  'MockFoo',
-  TRUE,
-  TRUE
-);
-
-print $mock['code'];
-?>
---EXPECTF--
-class Foo
-{
-}
-
-class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
-{
-    private $__phpunit_invocationMocker;
-    private $__phpunit_originalObject;
-
-    public function __clone()
-    {
-        $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
-    }
-
-    public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
-    {
-        return $this->__phpunit_getInvocationMocker()->expects($matcher);
-    }
-
-    public function method()
-    {
-        $any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
-        $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
-    }
-
-    public function __phpunit_setOriginalObject($originalObject)
-    {
-        $this->__phpunit_originalObject = $originalObject;
-    }
-
-    public function __phpunit_getInvocationMocker()
-    {
-        if ($this->__phpunit_invocationMocker === NULL) {
-            $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
-        }
-
-        return $this->__phpunit_invocationMocker;
-    }
-
-    public function __phpunit_hasMatchers()
-    {
-        return $this->__phpunit_getInvocationMocker()->hasMatchers();
-    }
-
-    public function __phpunit_verify()
-    {
-        $this->__phpunit_getInvocationMocker()->verify();
-        $this->__phpunit_invocationMocker = NULL;
-    }
-}
diff --git a/core/vendor/phpunit/phpunit/tests/Util/TestTest.php b/core/vendor/phpunit/phpunit/tests/Util/TestTest.php
deleted file mode 100644
index 99e55bd..0000000
--- a/core/vendor/phpunit/phpunit/tests/Util/TestTest.php
+++ /dev/null
@@ -1,538 +0,0 @@
-<?php
-/**
- * PHPUnit
- *
- * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- *   * Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *
- *   * Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in
- *     the documentation and/or other materials provided with the
- *     distribution.
- *
- *   * Neither the name of Sebastian Bergmann nor the names of his
- *     contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package    PHPUnit
- * @author     Sebastian Bergmann <sebastian@phpunit.de>
- * @copyright  2001-2014 Sebastian Bergmann <sebastian@phpunit.de>
- * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
- * @link       http://www.phpunit.de/
- * @since      File available since Release 3.3.6
- */
-
-if (!defined('TEST_FILES_PATH')) {
-    define(
-      'TEST_FILES_PATH',
-      dirname(__DIR__) . DIRECTORY_SEPARATOR .
-      '_files' . DIRECTORY_SEPARATOR
-    );
-}
-
-/**
- *
- *
- * @package    PHPUnit
- * @author     Sebastian Bergmann <sebastian@phpunit.de>
- * @copyright  2001-2014 Sebastian Bergmann <sebastian@phpunit.de>
- * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
- * @link       http://www.phpunit.de/
- * @since      Class available since Release 3.3.6
- */
-class Util_TestTest extends PHPUnit_Framework_TestCase
-{
-    /**
-     * @covers PHPUnit_Util_Test::getExpectedException
-     * @todo   Split up in separate tests
-     */
-    public function testGetExpectedException()
-    {
-        $this->assertSame(
-          array('class' => 'FooBarBaz', 'code' => null, 'message' => ''),
-          PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testOne')
-        );
-
-        $this->assertSame(
-          array('class' => 'Foo_Bar_Baz', 'code' => null, 'message' => ''),
-          PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testTwo')
-        );
-
-        $this->assertSame(
-          array('class' => 'Foo\Bar\Baz', 'code' => null, 'message' => ''),
-          PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testThree')
-        );
-
-        $this->assertSame(
-          array('class' => 'ほげ', 'code' => null, 'message' => ''),
-          PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testFour')
-        );
-
-        $this->assertSame(
-          array('class' => 'Class', 'code' => 1234, 'message' => 'Message'),
-          PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testFive')
-        );
-
-        $this->assertSame(
-          array('class' => 'Class', 'code' => 1234, 'message' => 'Message'),
-          PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testSix')
-        );
-
-        $this->assertSame(
-          array('class' => 'Class', 'code' => 'ExceptionCode', 'message' => 'Message'),
-          PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testSeven')
-        );
-
-        $this->assertSame(
-          array('class' => 'Class', 'code' => 0, 'message' => 'Message'),
-          PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testEight')
-        );
-
-        $this->assertSame(
-          array('class' => 'Class', 'code' => ExceptionTest::ERROR_CODE, 'message' => ExceptionTest::ERROR_MESSAGE),
-          PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testNine')
-        );
-
-        $this->assertSame(
-          array('class' => 'Class', 'code' => null, 'message' => ''),
-          PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testSingleLine')
-        );
-
-        $this->assertSame(
-            array('class' => 'Class', 'code' => My\Space\ExceptionNamespaceTest::ERROR_CODE, 'message' => My\Space\ExceptionNamespaceTest::ERROR_MESSAGE),
-            PHPUnit_Util_Test::getExpectedException('My\Space\ExceptionNamespaceTest', 'testConstants')
-        );
-
-        // Ensure the Class::CONST expression is only evaluated when the constant really exists
-        $this->assertSame(
-            array('class' => 'Class', 'code' => 'ExceptionTest::UNKNOWN_CODE_CONSTANT', 'message' => 'ExceptionTest::UNKNOWN_MESSAGE_CONSTANT'),
-            PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testUnknownConstants')
-        );
-
-        $this->assertSame(
-            array('class' => 'Class', 'code' => 'My\Space\ExceptionNamespaceTest::UNKNOWN_CODE_CONSTANT', 'message' => 'My\Space\ExceptionNamespaceTest::UNKNOWN_MESSAGE_CONSTANT'),
-            PHPUnit_Util_Test::getExpectedException('My\Space\ExceptionNamespaceTest', 'testUnknownConstants')
-        );
-    }
-
-    /**
-     * @covers       PHPUnit_Util_Test::getRequirements
-     * @dataProvider requirementsProvider
-     */
-    public function testGetRequirements($test, $result)
-    {
-        $this->assertEquals(
-          $result,
-          PHPUnit_Util_Test::getRequirements('RequirementsTest', $test)
-        );
-    }
-
-    public function requirementsProvider()
-    {
-        return array(
-            array('testOne',    array()),
-            array('testTwo',    array('PHPUnit' => '1.0')),
-            array('testThree',  array('PHP' => '2.0')),
-            array('testFour',   array('PHPUnit'=>'2.0', 'PHP' => '1.0')),
-            array('testFive',   array('PHP' => '5.4.0RC6')),
-            array('testSix',    array('PHP' => '5.4.0-alpha1')),
-            array('testSeven',  array('PHP' => '5.4.0beta2')),
-            array('testEight',  array('PHP' => '5.4-dev')),
-            array('testNine',   array('functions' => array('testFunc'))),
-            array('testTen',    array('extensions' => array('testExt'))),
-            array('testEleven', array('OS' => '/Linux/i')),
-            array(
-                'testSpace',
-                array(
-                    'extensions' => array('spl'),
-                    'OS' => '/.*/i'
-                )
-            ),
-            array(
-                'testAllPossibleRequirements',
-                array(
-                    'PHP' => '99-dev',
-                    'PHPUnit' => '9-dev',
-                    'OS' => '/DOESNOTEXIST/i',
-                    'functions' => array(
-                        'testFuncOne',
-                        'testFuncTwo',
-                    ),
-                    'extensions' => array(
-                        'testExtOne',
-                        'testExtTwo',
-                    )
-                )
-            )
-        );
-    }
-
-    /**
-     * @covers PHPUnit_Util_Test::getRequirements
-     */
-    public function testGetRequirementsMergesClassAndMethodDocBlocks()
-    {
-        $expectedAnnotations = array(
-            'PHP' => '5.4',
-            'PHPUnit' => '3.7',
-            'OS' => '/WINNT/i',
-            'functions' => array(
-                'testFuncClass',
-                'testFuncMethod',
-            ),
-            'extensions' => array(
-                'testExtClass',
-                'testExtMethod',
-            )
-        );
-
-        $this->assertEquals(
-          $expectedAnnotations,
-          PHPUnit_Util_Test::getRequirements('RequirementsClassDocBlockTest', 'testMethod')
-        );
-    }
-
-    /**
-     * @coversNothing
-     * @todo   This test does not really test functionality of PHPUnit_Util_Test
-     */
-    public function testGetProvidedDataRegEx()
-    {
-        $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider method', $matches);
-        $this->assertEquals(1, $result);
-        $this->assertEquals('method', $matches[1]);
-
-        $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider class::method', $matches);
-        $this->assertEquals(1, $result);
-        $this->assertEquals('class::method', $matches[1]);
-
-        $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider namespace\class::method', $matches);
-        $this->assertEquals(1, $result);
-        $this->assertEquals('namespace\class::method', $matches[1]);
-
-        $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider namespace\namespace\class::method', $matches);
-        $this->assertEquals(1, $result);
-        $this->assertEquals('namespace\namespace\class::method', $matches[1]);
-
-        $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider メソッド', $matches);
-        $this->assertEquals(1, $result);
-        $this->assertEquals('メソッド', $matches[1]);
-    }
-
-    /**
-     * @covers PHPUnit_Util_Test::getDependencies
-     * @todo   Not sure what this test tests (name is misleading at least)
-     */
-    public function testParseAnnotation()
-    {
-        $this->assertEquals(
-          array('Foo', 'ほげ'),
-          PHPUnit_Util_Test::getDependencies(get_class($this), 'methodForTestParseAnnotation')
-        );
-    }
-
-    /**
-     * @depends Foo
-     * @depends ほげ
-     * @todo    Remove fixture from test class
-     */
-    public function methodForTestParseAnnotation()
-    {
-    }
-
-    /**
-     * @covers PHPUnit_Util_Test::getDependencies
-     */
-    public function testParseAnnotationThatIsOnlyOneLine()
-    {
-        $this->assertEquals(
-          array('Bar'),
-          PHPUnit_Util_Test::getDependencies(get_class($this), 'methodForTestParseAnnotationThatIsOnlyOneLine')
-        );
-    }
-
-    /** @depends Bar */
-    public function methodForTestParseAnnotationThatIsOnlyOneLine()
-    {
-        // TODO Remove fixture from test class
-    }
-
-    /**
-     * @covers       PHPUnit_Util_Test::getLinesToBeCovered
-     * @covers       PHPUnit_Util_Test::resolveElementToReflectionObjects
-     * @dataProvider getLinesToBeCoveredProvider
-     */
-    public function testGetLinesToBeCovered($test, $lines)
-    {
-        if (strpos($test, 'Namespace') === 0) {
-            $expected = array(
-              TEST_FILES_PATH . 'NamespaceCoveredClass.php' => $lines
-            );
-        }
-
-        else if ($test === 'CoverageNoneTest') {
-            $expected = array();
-        }
-
-        else if ($test === 'CoverageNothingTest') {
-            $expected = false;
-        }
-
-        else if ($test === 'CoverageFunctionTest') {
-            $expected = array(
-              TEST_FILES_PATH . 'CoveredFunction.php' => $lines
-            );
-        }
-
-        else {
-            $expected = array(TEST_FILES_PATH . 'CoveredClass.php' => $lines);
-        }
-
-        $this->assertEquals(
-          $expected,
-          PHPUnit_Util_Test::getLinesToBeCovered(
-            $test, 'testSomething'
-          )
-        );
-    }
-
-    /**
-     * @covers            PHPUnit_Util_Test::getLinesToBeCovered
-     * @covers            PHPUnit_Util_Test::resolveElementToReflectionObjects
-     * @expectedException PHPUnit_Framework_CodeCoverageException
-     */
-    public function testGetLinesToBeCovered2()
-    {
-        PHPUnit_Util_Test::getLinesToBeCovered(
-          'NotExistingCoveredElementTest', 'testOne'
-        );
-    }
-
-    /**
-     * @covers            PHPUnit_Util_Test::getLinesToBeCovered
-     * @covers            PHPUnit_Util_Test::resolveElementToReflectionObjects
-     * @expectedException PHPUnit_Framework_CodeCoverageException
-     */
-    public function testGetLinesToBeCovered3()
-    {
-        PHPUnit_Util_Test::getLinesToBeCovered(
-          'NotExistingCoveredElementTest', 'testTwo'
-        );
-    }
-
-    /**
-     * @covers            PHPUnit_Util_Test::getLinesToBeCovered
-     * @covers            PHPUnit_Util_Test::resolveElementToReflectionObjects
-     * @expectedException PHPUnit_Framework_CodeCoverageException
-     */
-    public function testGetLinesToBeCovered4()
-    {
-        PHPUnit_Util_Test::getLinesToBeCovered(
-          'NotExistingCoveredElementTest', 'testThree'
-        );
-    }
-
-    /**
-     * @covers PHPUnit_Util_Test::getLinesToBeCovered
-     */
-    public function testGetLinesToBeCoveredSkipsNonExistantMethods()
-    {
-        $this->assertSame(
-          array(),
-          PHPUnit_Util_Test::getLinesToBeCovered(
-            'NotExistingCoveredElementTest',
-            'methodDoesNotExist'
-          )
-        );
-    }
-
-    /**
-     * @covers PHPUnit_Util_Test::getLinesToBeCovered
-     * @expectedException PHPUnit_Framework_CodeCoverageException
-     */
-    public function testTwoCoversDefaultClassAnnoationsAreNotAllowed()
-    {
-        PHPUnit_Util_Test::getLinesToBeCovered(
-          'CoverageTwoDefaultClassAnnotations',
-          'testSomething'
-        );
-    }
-
-    /**
-     * @covers PHPUnit_Util_Test::getLinesToBeCovered
-     */
-    public function testFunctionParenthesesAreAllowed()
-    {
-        $this->assertSame(
-          array(TEST_FILES_PATH . 'CoveredFunction.php' => range(2, 4)),
-          PHPUnit_Util_Test::getLinesToBeCovered(
-            'CoverageFunctionParenthesesTest',
-            'testSomething'
-          )
-        );
-    }
-
-    /**
-     * @covers PHPUnit_Util_Test::getLinesToBeCovered
-     */
-    public function testFunctionParenthesesAreAllowedWithWhitespace()
-    {
-        $this->assertSame(
-          array(TEST_FILES_PATH . 'CoveredFunction.php' => range(2, 4)),
-          PHPUnit_Util_Test::getLinesToBeCovered(
-            'CoverageFunctionParenthesesWhitespaceTest',
-            'testSomething'
-          )
-        );
-    }
-
-    /**
-     * @covers PHPUnit_Util_Test::getLinesToBeCovered
-     */
-    public function testMethodParenthesesAreAllowed()
-    {
-        $this->assertSame(
-          array(TEST_FILES_PATH . 'CoveredClass.php' => range(31, 35)),
-          PHPUnit_Util_Test::getLinesToBeCovered(
-            'CoverageMethodParenthesesTest',
-            'testSomething'
-          )
-        );
-    }
-
-    /**
-     * @covers PHPUnit_Util_Test::getLinesToBeCovered
-     */
-    public function testMethodParenthesesAreAllowedWithWhitespace()
-    {
-        $this->assertSame(
-          array(TEST_FILES_PATH . 'CoveredClass.php' => range(31, 35)),
-          PHPUnit_Util_Test::getLinesToBeCovered(
-            'CoverageMethodParenthesesWhitespaceTest',
-            'testSomething'
-          )
-        );
-    }
-
-    public function getLinesToBeCoveredProvider()
-    {
-        return array(
-          array(
-            'CoverageNoneTest',
-            array()
-          ),
-          array(
-            'CoverageClassExtendedTest',
-            array_merge(range(19, 36), range(2, 17))
-          ),
-          array(
-            'CoverageClassTest',
-            range(19, 36)
-          ),
-          array(
-            'CoverageMethodTest',
-            range(31, 35)
-          ),
-          array(
-            'CoverageMethodOneLineAnnotationTest',
-            range(31, 35)
-          ),
-          array(
-            'CoverageNotPrivateTest',
-            array_merge(range(25, 29), range(31, 35))
-          ),
-          array(
-            'CoverageNotProtectedTest',
-            array_merge(range(21, 23), range(31, 35))
-          ),
-          array(
-            'CoverageNotPublicTest',
-            array_merge(range(21, 23), range(25, 29))
-          ),
-          array(
-            'CoveragePrivateTest',
-            range(21, 23)
-          ),
-          array(
-            'CoverageProtectedTest',
-            range(25, 29)
-          ),
-          array(
-            'CoveragePublicTest',
-            range(31, 35)
-          ),
-          array(
-            'CoverageFunctionTest',
-            range(2, 4)
-          ),
-          array(
-            'NamespaceCoverageClassExtendedTest',
-            array_merge(range(21, 38), range(4, 19))
-          ),
-          array(
-            'NamespaceCoverageClassTest',
-            range(21, 38)
-          ),
-          array(
-            'NamespaceCoverageMethodTest',
-            range(33, 37)
-          ),
-          array(
-            'NamespaceCoverageNotPrivateTest',
-            array_merge(range(27, 31), range(33, 37))
-          ),
-          array(
-            'NamespaceCoverageNotProtectedTest',
-            array_merge(range(23, 25), range(33, 37))
-          ),
-          array(
-            'NamespaceCoverageNotPublicTest',
-            array_merge(range(23, 25), range(27, 31))
-          ),
-          array(
-            'NamespaceCoveragePrivateTest',
-            range(23, 25)
-          ),
-          array(
-            'NamespaceCoverageProtectedTest',
-            range(27, 31)
-          ),
-          array(
-            'NamespaceCoveragePublicTest',
-            range(33, 37)
-          ),
-          array(
-            'NamespaceCoverageCoversClassTest',
-            array_merge(range(23, 25), range(27, 31), range(33, 37), range(6, 8), range(10, 13), range(15, 18))
-          ),
-          array(
-            'NamespaceCoverageCoversClassPublicTest',
-            range(33, 37)
-          ),
-          array(
-            'CoverageNothingTest',
-            false
-          )
-        );
-    }
-}
diff --git a/core/vendor/phpunit/phpunit/tests/_files/ExceptionInSetUpTest.php b/core/vendor/phpunit/phpunit/tests/_files/ExceptionInSetUpTest.php
deleted file mode 100644
index 9c48030..0000000
--- a/core/vendor/phpunit/phpunit/tests/_files/ExceptionInSetUpTest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-class ExceptionInSetUpTest extends PHPUnit_Framework_TestCase
-{
-    public $setUp = false;
-    public $assertPreConditions = false;
-    public $assertPostConditions = false;
-    public $tearDown = false;
-    public $testSomething = false;
-
-    protected function setUp()
-    {
-        $this->setUp = true;
-        throw new Exception;
-    }
-
-    protected function assertPreConditions()
-    {
-        $this->assertPreConditions = true;
-    }
-
-    public function testSomething()
-    {
-        $this->testSomething = true;
-    }
-
-    protected function assertPostConditions()
-    {
-        $this->assertPostConditions = true;
-    }
-
-    protected function tearDown()
-    {
-        $this->tearDown = true;
-    }
-}
diff --git a/core/vendor/phpunit/phpunit/tests/_files/ExceptionInTest.php b/core/vendor/phpunit/phpunit/tests/_files/ExceptionInTest.php
deleted file mode 100644
index 4ca556e..0000000
--- a/core/vendor/phpunit/phpunit/tests/_files/ExceptionInTest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-class ExceptionInTest extends PHPUnit_Framework_TestCase
-{
-    public $setUp = false;
-    public $assertPreConditions = false;
-    public $assertPostConditions = false;
-    public $tearDown = false;
-    public $testSomething = false;
-
-    protected function setUp()
-    {
-        $this->setUp = true;
-    }
-
-    protected function assertPreConditions()
-    {
-        $this->assertPreConditions = true;
-    }
-
-    public function testSomething()
-    {
-        $this->testSomething = true;
-        throw new Exception;
-    }
-
-    protected function assertPostConditions()
-    {
-        $this->assertPostConditions = true;
-    }
-
-    protected function tearDown()
-    {
-        $this->tearDown = true;
-    }
-}
