Skip to content
Snippets Groups Projects
Commit 77056aed authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[BUGFIX] Incomplete setup in ImageViewHelperTest

* Arguments with default values are registered with their
  default values in fluid by default. Tests that circumvent
  argument initialization by setting them directly must set
  them. The patch adds this for the "exception" tests in
  ImageViewHelperTest.

* The main tests of ImageViewHelperTest run in backend scope.
  The FAL logic triggers StoragePermissionsAspect in this
  scope, which needs a $GLOBALS['BE_USER'], but that is not
  set up by the tests. The patch initializes a backend user.

Change-Id: I91280cf869bf4609c20387132d076267e54b9b7a
Resolves: #95531
Releases: master
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71493


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: default avatarNikita Hovratov <nikita.h@live.de>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 8a210a68
Branches
Tags
No related merge requests found
......@@ -27,11 +27,11 @@ class ImageViewHelperTest extends FunctionalTestCase
public function invalidArgumentsDataProvider(): array
{
return [
[['image' => null], 1382284106],
[['src' => null], 1382284106],
[['src' => ''], 1382284106],
[['src' => '', 'image' => null], 1382284106],
[['src' => null, 'image' => null], 1382284106],
[['src' => '', 'image' => null], 1382284106],
[['src' => 'something', 'image' => 'something'], 1382284106],
[['src' => 'something', 'fileExtension' => 'dummy'], 1618989190],
[['src' => 'something', 'image' => null, 'fileExtension' => 'dummy'], 1618989190],
];
}
......@@ -73,6 +73,7 @@ class ImageViewHelperTest extends FunctionalTestCase
*/
public function renderReturnsExpectedMarkup(string $template, string $expected): void
{
$this->setUpBackendUserFromFixture(1);
$view = new StandaloneView();
$view->setTemplateSource($template);
self::assertMatchesRegularExpression($expected, $view->render());
......
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