Bug #100183
closedMock calls in DatabaseUserPermissionCheckTest do not match the called method's types
100%
Description
In \TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\DatabaseUserPermissionCheckTest, two tests call BackendUserAuthentication::check with a string and and int, while the method's contract states that it should be called with two strings. One of them must be wrong. :-)
The two tests are:
- addDataThrowsExceptionIfCommandIsEditTableIsPagesAndUserHasNoDoktypePermissions
- addDataAddsUserPermissionsOnPageIfTableIsPagesAndUserHasPagePermissions
Updated by Oliver Klee over 1 year ago
Some more thoughts:
The tests pass the "doktype" page data as an int value, while the method expects a string.
We probably need to debug what type is passed when BackendUserAuthentication::check is called in production, and then either
a) change the test data from int to string, and change string|int in the anonymous function to string, or
b) change the BackendUserAuthentication::check and its called methods from string to string|int
Updated by Gerrit Code Review over 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78778
Updated by Benni Mack over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f49ee3f6af8fca8e49a1ab7719df570c2bb1e0fe.