Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Fix support for typo3fluid/fluid 2.15 #3390

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

bwaidelich
Copy link
Member

@bwaidelich bwaidelich commented Sep 3, 2024

Adjusts tests that mocked AbstractViewHelper::renderChildren() that is no longer invoked with version 2.15

Fixes: #3389

Adjusts tests that mocked `AbstractViewHelper::renderChildren()` that is no longer invoked with version 2.15

protected function simulateViewHelperChildNodeContent(AbstractViewHelper&MockObject $viewHelper, string|int $content): void
{
$viewHelper->method('renderChildren')->willReturn($content);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This line is no longer required with Fluid 2.15 – but it allows the tests to pass with older versions of Fluid

Copy link
Contributor

@dlubitz dlubitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@bwaidelich bwaidelich merged commit 60c61f8 into 9.0 Sep 3, 2024
8 checks passed
@bwaidelich bwaidelich deleted the bugfix/3389-fix-support-for-fluid-2.15 branch September 3, 2024 12:02
@lolli42
Copy link
Contributor

lolli42 commented Sep 9, 2024

Quick note.
You may be better off avoiding mocks in VH tests.
Both fluid standalone and typo3 core basically transitioned to "functional" tests: Feed a TemplateView with some fluid template test string that calls the VH, render(), assert result string.
This turns out to be much more easy to read and avoids internal knowledge within tests.
Bonus: It's trivial to do this twice to test if a VH behaves identical with "template not cached and template cached" (we found and fixed quite a few issues due to this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fluid 2.15 breaks unit tests
3 participants