Skip to content

Commit

Permalink
EWPP-164: Refactor tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
drishu committed Jan 19, 2021
1 parent 845d656 commit 4d3d620
Show file tree
Hide file tree
Showing 9 changed files with 266 additions and 372 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Drupal\media\MediaInterface;
use Drupal\oe_content_event\EventNodeWrapper;
use Drupal\oe_theme\ValueObject\ImageValueObject;
use Drupal\oe_theme\ValueObject\MediaValueObject;
use Drupal\oe_time_caching\Cache\TimeBasedCacheTagGeneratorInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

Expand Down
2 changes: 2 additions & 0 deletions modules/oe_theme_helper/src/TwigExtension/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Drupal\oe_theme_helper\EuropeanUnionLanguages;
use Drupal\smart_trim\Truncate\TruncateHTML;
use Drupal\Core\Template\TwigExtension as CoreTwigExtension;
use Drupal\oe_theme\ValueObject\MediaValueObject;

/**
* Collection of extra Twig extensions as filters and functions.
Expand Down Expand Up @@ -69,6 +70,7 @@ public function getFilters(): array {
new \Twig_SimpleFilter('smart_trim', [$this, 'smartTrim'], ['needs_environment' => TRUE]),
new \Twig_SimpleFilter('is_external_url', [UrlHelper::class, 'isExternal']),
new \Twig_SimpleFilter('filter_empty', [$this, 'filterEmpty']),
new \Twig_SimpleFilter('validate_ratio', [MediaValueObject::class, 'validateRatio']),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
* Media container pattern.
*/
#}
{% set _ratio = media.ratio|default('16-9') %}

{% include '@ecl-twig/media-container' with {
'image': media.image.src,
'alt': media.image.alt,
'embedded_media': media.video,
'ratio': media.ratio,
'ratio': _ratio|validate_ratio,
'description': description,
'sources': media.sources,
'tracks': media.tracks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
{% if media.image or media.video %}
<div class="ecl-col-md-6 ecl-u-order-md-last ecl-u-mb-m ecl-u-mb-md-none">
{{ pattern('media_container', {
'compliance': compliance,
'description': caption,
'media': media
}) }}
Expand Down
65 changes: 0 additions & 65 deletions tests/Kernel/Patterns/MediaContainerPatternRenderingTest.php

This file was deleted.

65 changes: 0 additions & 65 deletions tests/Kernel/Patterns/TextFeaturedMediaPatternTest.php

This file was deleted.

94 changes: 0 additions & 94 deletions tests/Kernel/fixtures/patterns/media_container_pattern.yml

This file was deleted.

107 changes: 0 additions & 107 deletions tests/Kernel/fixtures/patterns/text_featured_media.yml

This file was deleted.

Loading

0 comments on commit 4d3d620

Please sign in to comment.