#100183Mock calls in DatabaseUserPermissionCheckTest do not match the called method's types
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
Reviews 1
History 34
-
Oliver Klee commented 04/20/23, 15:16
-
Gerrit Code Review pushed patch set 1 for main to change 78778 status
NewUnder Review 04/20/23, 19:15 -
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % 04/21/23, 05:05Applied in changeset commit:f49ee3f6af8fca8e49a1ab7719df570c2bb1e0fe.
-
Benni Mack changed status
ResolvedClosed 07/09/24, 12:46
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