aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/integration/includes/StubObject
Commit message (Collapse)AuthorAgeFilesLines
* Fix some local test failuresTim Starling2025-02-102-22/+0
| | | | | | | | | | | | | | | | | * Many tests failed if $wgAutoCreateTempUser['enabled'] was not set. This is set in DevelopmentSettings.php. Set it in TestSetup.php. * The Asia/Calcutta timezone, described as deprecated, is missing from my system. Remove the test case. * Three stub object tests called error_reporting(-1) on setUp() and restored it on tearDown(), but our check for preserved error level now runs as a postCondition hook, before tearDown(). This worked anyway for most people because DevelopmentSettings.php also has error_reporting(-1). Remove the error_reporting(-1) calls from the tests since it's not actually needed to pass -- we intercept deprecation calls at the application level. I confirmed that this fix works with php -d error_reporting=0. Change-Id: Ia43ce26345a0a8432c41b46907de2dfbffa00670
* Remove 2-line PHPDocs that just repeat the types from the codethiemowmde2025-01-171-2/+0
| | | | | | | | | | | | | | | | Same as Ia294bf4 did for 1-line comments. This patch removes slightly more complex 2-line PHPDoc comments that don't add any new information to the code, but literally repeat what the code already says. They say "don't document the code, code the documentation", and we are doing this more and more. We just tend to forget to remove the obsolete comments. Note I'm also removing a line of text in a few cases when it's very short and literally says the same as the method name. Again, such comments add zero new information. Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
* Remove trivial 1-line PHPDocs that just repeat the codethiemowmde2025-01-161-6/+0
| | | | | | | | | | | | | I assume these are all either auto-generated by an IDE or the language-level type declarations have been added later. In any case the comments don't add any new information to what the code already says. This is just extra clutter that makes the code harder to read, I would argue. There are many, many more comments like this. In this patch I intentionally focus on the most trivial 1-line comments. Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
* Replace gettype() with get_debug_type() in exception messagesBartosz DziewoƄski2024-07-311-1/+1
| | | | | | | | | | | | | | | | | | | get_debug_type() does the same thing but better (spelling type names in the same way as in type declarations, and including names of object classes and resource types). It was added in PHP 8, but the symfony/polyfill-php80 package provides it while we still support 7.4. Also remove uses of get_class() and get_resource_type() where the new method already provides the same information. For reference: https://www.php.net/manual/en/function.get-debug-type.php https://www.php.net/manual/en/function.gettype.php To keep this safe and simple to review, I'm only changing cases where the type is immediately used in an exception message. Change-Id: I325efcddcb58be63b1592b9c20ac0845393c15e2
* Namespace User under \MediaWiki\UserJames D. Forrester2023-09-191-0/+1
| | | | | Bug: T166010 Change-Id: I7257302b485588af31384d4f7fc8e30551f161f1
* tests: Move test cases from /includes/ into sub folderUmherirrender2023-09-132-0/+386
Follow move of the tested class Most moves are part of T321882 Change-Id: I74ab45d6a5331dcb2ff0b65dc2cc7c6315146646