Commit 6429cc95 authored by Sam152's avatar Sam152 Committed by Sam152
Browse files

Issue #2648424 by emanuelrighetto, Sam152: FieldFormatter

parent 43882bc2
......@@ -7,7 +7,7 @@
namespace Drupal\colorbox\Plugin\Field\FieldFormatter;
use Drupal\colorbox\PageAttachmentInterface;
use Drupal\colorbox\ElementAttachmentInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
......@@ -56,10 +56,10 @@ class ColorboxFormatter extends ImageFormatterBase implements ContainerFactoryPl
* The view mode.
* @param array $third_party_settings
* Any third party settings settings.
* @param \Drupal\colorbox\PageAttachmentInterface $attachment
* @param \Drupal\colorbox\ElementAttachmentInterface $attachment
* Allow the library to be attached to the page.
*/
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityStorageInterface $image_style_storage, PageAttachmentInterface $attachment) {
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityStorageInterface $image_style_storage, ElementAttachmentInterface $attachment) {
parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
$this->imageStyleStorage = $image_style_storage;
$this->attachment = $attachment;
......
......@@ -76,7 +76,7 @@ class Colorbox extends ImageFieldTestBase {
$this->assertScript('modules/colorbox/styles/default/colorbox_style.js');
$this->assertScript('modules/colorbox/js/colorbox.js');
// Ensure the image appears with the relevant colorbox markup.
$this->assertRaw('rel="gallery-article-1" class="colorbox"');
$this->assertRaw('rel="gallery-article-1-');
// The script should not appear by default on the homepage.
$this->drupalGet('<front>');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment