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

[TASK] Update functional tests examples #4784

Merged

Conversation

brotkrueml
Copy link
Contributor

  • Remove superfluous "Test Case" comment
  • Add declare(strict_types=1); as best practise
  • Use @test annotation as best practise like the Core does
  • Add void return type as best practise
  • Add typo3/testing-framework as requirement to have code completion in the PHP files

Note: As this is set to be merged also to 12.4, the @test annotation is used (instead of the #[Test] annotation) to be compatible with testing framework v7 and v8 (v7 is compatible with phpunit 9/10 and TYPO3 v11/v12, v8 is compatible with phpunit 10/11 and TYPO3 v12/v13). In a follow-up only to main (v13) this will be changed to the annotation.

Releases: main, 12.4

Mainly:
- Remove superfluous "Test Case" comment
- Add `declare(strict_types=1);` as best practise
- Use `@test` annotation as best practise like the Core does
- Add `void` return type as best practise
- Add `typo3/testing-framework` as requirement to have code completion in the PHP files

Note: As this is set to be merged also to 12.4, the `@test` annotation is used (instead of the `#[Test]` annotation)
to be compatible with testing framework v7 and v8 (v7 is compatible with phpunit 9/10
and TYPO3 v11/v12, v8 is compatible with phpunit 10/11 and TYPO3 v12/v13).
In a follow-up only to main (v13) this will be changed to the annotation.

Releases: main, 12.4
@brotkrueml brotkrueml added the backport 12.4 Backport to TYPO3v12 label Sep 24, 2024
@brotkrueml brotkrueml self-assigned this Sep 24, 2024
Copy link
Contributor

@froemken froemken 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. Much better than the earlier "testMethod" solution.

Copy link
Member

@linawolf linawolf 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, looks food

@linawolf linawolf merged commit 6db5048 into TYPO3-Documentation:main Sep 30, 2024
6 checks passed
Copy link
Contributor

The backport to 12.4 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 530bcc2d8... [TASK] Update functional tests examples
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config advice.mergeConflict false"

stdout
Auto-merging composer.json
CONFLICT (content): Merge conflict in composer.json

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-12.4 12.4
# Navigate to the new working tree
cd .worktrees/backport-12.4
# Create a new branch
git switch --create backport-4784-to-12.4
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 530bcc2d84cf92ec6a382b5d865c75d44ebfa518,8dbe4bbf895c63e3117d869cf08c58e2fd90ac97,494bcb207f623e91f0c4e6117dc6d30b84aa02e3
# Push it to GitHub
git push --set-upstream origin backport-4784-to-12.4
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-12.4

Then, create a pull request where the base branch is 12.4 and the compare/head branch is backport-4784-to-12.4.

@brotkrueml
Copy link
Contributor Author

Will take care of the backport.

@brotkrueml brotkrueml deleted the functional-test-examples branch September 30, 2024 07:22
brotkrueml added a commit to brotkrueml/TYPO3CMS-Reference-CoreApi that referenced this pull request Sep 30, 2024
…tation#4784)

Mainly:
- Remove superfluous "Test Case" comment
- Add `declare(strict_types=1);` as best practise
- Use `@test` annotation as best practise like the Core does
- Add `void` return type as best practise
- Add `typo3/testing-framework` as requirement to have code completion in the PHP files

Releases: main, 12.4
brotkrueml added a commit to brotkrueml/TYPO3CMS-Reference-CoreApi that referenced this pull request Sep 30, 2024
This file is a leftover from TYPO3-Documentation#4784. It is already fixed in main with TYPO3-Documentation#4794.

Releases: 12.4
linawolf pushed a commit that referenced this pull request Sep 30, 2024
This file is a leftover from #4784. It is already fixed in main with #4794.

Releases: 12.4
linawolf pushed a commit that referenced this pull request Oct 1, 2024
Mainly:
- Remove superfluous "Test Case" comment
- Add `declare(strict_types=1);` as best practise
- Use `@test` annotation as best practise like the Core does
- Add `void` return type as best practise
- Add `typo3/testing-framework` as requirement to have code completion in the PHP files

Releases: main, 12.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants