Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Build/phpunit/FunctionalTests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
stopOnSkipped="false"
beStrictAboutTestsThatDoNotTestAnything="false"
failOnWarning="true"
failOnDeprecation="false"
failOnDeprecation="true"
>
<testsuites>
<testsuite name="Functional tests">
Expand Down
4 changes: 2 additions & 2 deletions Classes/ViewHelpers/ImageViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct()
public function initializeArguments(): void
{
parent::initializeArguments();
if ((new Typo3Version())->getMajorVersion() < 14) {
if ((new Typo3Version())->getMajorVersion() < 13) {
$this->registerUniversalTagAttributes();
// attributes from fluid VH
$this->registerTagAttribute('alt', 'string', 'Specifies an alternate text for an image', false);
Expand Down Expand Up @@ -291,7 +291,7 @@ protected function buildSingleTag(string $tagName, array $configuration, FileInt
$tag->addAttribute('loading', $this->pictureConfiguration->getLazyLoading());
}

if ((new Typo3Version())->getMajorVersion() < 14) {
if ((new Typo3Version())->getMajorVersion() < 13) {
$alt = $this->arguments['alt'] ?? $image->getProperty('alternative');
$title = $this->arguments['title'] ?? $image->getProperty('title');
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:i="http://typo3.org/ns/B13/Picture/ViewHelpers"
data-namespace-typo3-fluid="true"
>
<f:spaceless>
<i:image src="EXT:picture/Resources/Public/Test/Picture.png" foo="bar" width="400" alt="Testimage 400px width" />
</f:spaceless>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"pages"
,"uid","pid","title","slug"
,1,0,"root","/"
"sys_template"
,"uid","pid","root","constants","config"
,1,1,1,styles.content.image.lazyLoading=lazy,"@import 'EXT:picture/Configuration/TypoScript/test.typoscript'
page = PAGE
page.config.disableAllHeaderCode = 1
page.10 = FLUIDTEMPLATE
page.10.templateRootPaths.10 = EXT:picture/Tests/Functional/Frontend/Fixtures/Templates
page.10.templateName = SimpleImageWithAdditionalAttributes.html
config.absRefPrefix = /
"
10 changes: 10 additions & 0 deletions Tests/Functional/Frontend/TagRenderingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ public function simpleImage(): void
self::assertStringContainsString($this->anonymouseProcessdImage($expected), $this->anonymouseProcessdImage($body));
}

#[Test]
public function simpleImageWithAdditionalAttributes(): void
{
$this->importCSVDataSet(__DIR__ . '/Fixtures/simple_image_with_additional_attributes.csv');
$response = $this->executeFrontendSubRequest(new InternalRequest('http://localhost/'));
$body = (string)$response->getBody();
$expected = '<img foo="bar" alt="Testimage 400px width" src="/typo3temp/assets/_processed_/a/2/csm_Picture_23f7889ff5.png" width="400" height="200" loading="lazy" />';
self::assertStringContainsString($this->anonymouseProcessdImage($expected), $this->anonymouseProcessdImage($body));
}

#[Test]
public function simpleImageAsWebp(): void
{
Expand Down