Project

General

Profile

Actions

Bug #100183

closed

Mock calls in DatabaseUserPermissionCheckTest do not match the called method's types

Added by Oliver Klee over 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2023-03-16
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Actions #1

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

Actions #2

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

Actions #3

Updated by Benni Mack over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF