Skip to content

Issue #122: Updated class name for locallib_test#123

Merged
micoreyes merged 2 commits into
MOODLE_401_STABLEfrom
MOODLE_401_STABLE-issue122
Jun 12, 2026
Merged

Issue #122: Updated class name for locallib_test#123
micoreyes merged 2 commits into
MOODLE_401_STABLEfrom
MOODLE_401_STABLE-issue122

Conversation

@niko-hoogeveen

Copy link
Copy Markdown
Contributor

Closes issue #122.

Updated the class name for locallib_test.php to match the file name. This allows the tests to be run properly.

Environment

- Moodle 5.1.3+ (Build: 20260220)
- PHP: 8.4.22
- DB: MySQL 8.4
- Branch: MOODLE_401_STABLE

Testing instructions:

  • tool_securityquestions test suite: vendor/bin/phpunit --testsuite tool_securityquestions_testsuite
  • Running the unit tests for tool_securityquestions will produce the following output (on the above environment):
Moodle 5.1.3+ (Build: 20260220)
Php: 8.4.22, mysqli: 8.4.9, OS: Linux 6.17.0-1025-oem x86_64
PHPUnit 11.5.12 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.22
Configuration: /var/www/upstream-mdl/phpunit.xml

There was 1 PHPUnit test runner warning:

1) Class locallib_test cannot be found in /var/www/upstream-mdl/public/admin/tool/securityquestions/tests/locallib_test.php

No tests executed!

Expected Output from PHPUnit Tests

  • Pulling this branch MOODLE_401_STABLE-issue122 and re-running the testsuite:
Moodle 5.1.3+ (Build: 20260220)
Php: 8.4.22, mysqli: 8.4.9, OS: Linux 6.17.0-1025-oem x86_64
PHPUnit 11.5.12 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.22
Configuration: /var/www/upstream-mdl/phpunit.xml

................................                                  32 / 32 (100%)

Time: 00:05.930, Memory: 72.50 MB

OK, but there were issues!
Tests: 32, Assertions: 151, PHPUnit Deprecations: 2.

@micoreyes

Copy link
Copy Markdown
Contributor

N can you add

namespace tool_securityquestions; As the name locallib_test is super common.

@micoreyes micoreyes merged commit 11a0316 into MOODLE_401_STABLE Jun 12, 2026
25 of 35 checks passed
@micoreyes micoreyes deleted the MOODLE_401_STABLE-issue122 branch June 12, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants