View Issue Details

IDProjectCategoryView StatusLast Update
0035223mantisbtotherpublic2025-01-15 10:45
Reporterraspopov Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status assignedResolutionreopened 
Product Version2.27.0 
Target Version2.28.0Fixed in Version2.28.0 
Summary0035223: MantisBT tests are not compatible with PHPUnit 11.5
Description

The execution of tests is interrupted by several warnings about outdated signatures of the methods of the test providers.

TagsNo tags attached.

Activities

raspopov

raspopov

2025-01-09 10:56

reporter   ~0069648

PR: https://github.com/mantisbt/mantisbt/pull/2069

dregad

dregad

2025-01-09 12:31

developer   ~0069651

Thanks for this, but that can't be merged in the near future, the reason being that PHPUnit 11 requires PHP 8.2 or later, which is not compatible with MantisBT minimum requirements (7.4).

Our test suite is currently targeted at 9.6, which you should be running with vendor/bin/phpunit from the MantisBT root.

For the record I already faced some issues while testing PHPUnit 10 a few months back, see https://github.com/mantisbt/mantisbt/compare/master...dregad:mantisbt:phpunit-10-getname

raspopov

raspopov

2025-01-15 10:34

reporter   ~0069687

Complete the compatibility with PHPUnit 11.
PR: https://github.com/mantisbt/mantisbt/pull/2074

PHPUnit 11.5.2 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.14
Configuration: C:\Projects\mantisbt\phpunit.xml

...............................................................  63 / 450 ( 14%)
............................................................... 126 / 450 ( 28%)
............................................................SS. 189 / 450 ( 42%)
.................................S..........S.SS............... 252 / 450 ( 56%)
...S......SSSS................................................S 315 / 450 ( 70%)
SSS...........................S..................S............. 378 / 450 ( 84%)
S...SS.S...S......................................FF........... 441 / 450 ( 98%)
.........                                                       450 / 450 (100%)

Time: 18:29.978, Memory: 32.00 MB

--

There were 22 skipped tests:

1) AttachmentTest::testProjectAttachmentIsAdded
Project documentation is not enabled.

2) AttachmentTest::testProjectAttachmentNotFound
Project documentation is not enabled.

3) FilterTest::testGetProjectIssuesWithoutCategory
g_allow_no_category is not ON.

4) IssueAddTest::testCreateIssueWithDueDate
Due date thresholds are too high.

5) IssueAddTest::testCreateBugWithNoCategory
g_allow_no_category is not ON.

6) IssueAddTest::testCreateIssueWithTimeTrackingNote
Time tracking is not enabled

7) IssueNoteTest::testAddNoteWithTimeTracking
Time tracking is not enabled

8) IssueUpdateTest::testUpdateIssueDueDate
Due date thresholds are too high.

9) IssueUpdateTest::testUpdateBugWithNoCategory
g_allow_no_category is not ON.

10) IssueUpdateTest::testUpdateWithTimeTrackingNote
Time tracking is not enabled

11) IssueUpdateTest::testUpdateWithRareFields
Product build is not enabled

12) RestIssueTest::testCreateIssueWithVersionString
There must be at least 3 active versions defined in project 1

13) RestIssueTest::testCreateIssueWithVersionObjectName
There must be at least 1 active versions defined in project 1

14) RestIssueTest::testCreateIssueWithVersionObjectId
There must be at least 1 active versions defined in project 1

15) RestIssueTest::testCreateIssueWithVersionObjectIdAndMismatchingName
There must be at least 2 active versions defined in project 1

16) RestProjectVersionTest::testProjectDeleteVersionAnonymous
Anonymous access is not enabled

17) RestUserTest::testCreateUserAnonymous
Anonymous access is not enabled

18) RestUserTest::testUpdateUserAnonymous
Anonymous access is not enabled

19) RestUserTest::testGetUserByIdAnonymous
Anonymous access is not enabled

20) RestUserTest::testGetUserByIdNotFoundAnonymous
Anonymous access is not enabled

21) RestUserTest::testGetUserByIdZeroAnonymous
Anonymous access is not enabled

22) RestUserTest::testDeleteUserByIdAnonymous
Anonymous access is not enabled

FAILURES!
Tests: 450, Assertions: 1662, Failures: 2, PHPUnit Deprecations: 47, Skipped: 22.

The two failures are a known issue with Parsedown 1.8.

raspopov

raspopov

2025-01-15 10:45

reporter   ~0069688

"PHPUnit Deprecations" relate solely to the future requirement to use PHP attributes instead of comments for PHPUnit 12.

Related Changesets

MantisBT: master 537ea036

2025-01-09 10:34

raspopov

Committer: dregad


Details Diff
PHPUnit provider signatures must be static

Non-static providers deprecated in PHPUnit 10.0, removed in 11.0 [1].

Fixes 0035223, PR https://github.com/mantisbt/mantisbt/pull/2069

[1]: https://github.com/sebastianbergmann/phpunit/issues/5100
Affected Issues
0035223
mod - plugins/MantisCoreFormatting/tests/MarkdownTest.php Diff File
mod - tests/Mantis/ConfigParserTest.php Diff File
mod - tests/Mantis/Helper/ArrayTransposeTest.php Diff File
mod - tests/Mantis/Helper/GetLinkAttributesTest.php Diff File
mod - tests/Mantis/MentionParsingTest.php Diff File
mod - tests/Mantis/PluginTest.php Diff File
mod - tests/Mantis/PrepareTest.php Diff File
mod - tests/Mantis/StringTest.php Diff File
mod - tests/Mantis/UserApiTest.php Diff File
mod - tests/rest/RestIssueTest.php Diff File
mod - tests/rest/RestIssueUpdateVersion.php Diff File
mod - tests/rest/RestProjectVersionTest.php Diff File
mod - tests/rest/RestUserTest.php Diff File

MantisBT: master 382b34e2

2025-01-09 10:36

raspopov

Committer: dregad


Details Diff
Fix wrong parameter names

PHPUnit 10.5 deprecated use of string array keys that do not match the
method arguments [1], causes error in PHPUnit 11.

Fixes 0035223, PR https://github.com/mantisbt/mantisbt/pull/2069

[1]: https://github.com/sebastianbergmann/phpunit/pull/5812
Affected Issues
0035223
mod - tests/Mantis/Helper/GetLinkAttributesTest.php Diff File