Skip to content

Commit b3531eb

Browse files
authored
test: move isolated-compatible tests to isolated suite (openemr#12010)
## Summary - Move PasswordVerifyTest (34 tests) to `tests/Tests/Isolated/Common/Auth/` - Move HandleProcessingResultTest (5 tests) to `tests/Tests/Isolated/RestControllers/` - Move SessionUtilReadAndCloseTest (16 tests) to `tests/Tests/Isolated/Common/Session/` - Removes a no-op flag in the test config (defined, never read - it's misleading) - Update PHPStan baseline to reflect new file paths. No change. These tests have no database or bootstrap dependencies and pass under the isolated test configuration. ## Test plan - [x] `composer phpunit-isolated` passes with 55 additional tests - [x] Main suite test count reduced by 55 - [x] Isolated suite increased by same number I've verified the counts manually checking CI results from this branch vs head of master. 🤖 Generated with [Claude Code](https://claude.ai/code)
1 parent 5f7f2f3 commit b3531eb

8 files changed

Lines changed: 39 additions & 41 deletions

File tree

.phpstan/baseline/argument.type.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74496,6 +74496,11 @@
7449674496
'count' => 1,
7449774497
'path' => __DIR__ . '/../../tests/Tests/Isolated/RestControllers/Authorization/OAuth2PublicJsonWebKeyControllerTest.php',
7449874498
];
74499+
$ignoreErrors[] = [
74500+
'message' => '#^Parameter \\#1 \\$processingResult of static method OpenEMR\\\\RestControllers\\\\RestControllerHelper\\:\\:handleProcessingResult\\(\\) expects OpenEMR\\\\Validators\\\\ProcessingResult, mixed given\\.$#',
74501+
'count' => 5,
74502+
'path' => __DIR__ . '/../../tests/Tests/Isolated/RestControllers/HandleProcessingResultTest.php',
74503+
];
7449974504
$ignoreErrors[] = [
7450074505
'message' => '#^Parameter \\#2 \\$string of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringStartsWith\\(\\) expects string, mixed given\\.$#',
7450174506
'count' => 2,
@@ -74766,11 +74771,6 @@
7476674771
'count' => 18,
7476774772
'path' => __DIR__ . '/../../tests/Tests/RestControllers/FacilityRestControllerTest.php',
7476874773
];
74769-
$ignoreErrors[] = [
74770-
'message' => '#^Parameter \\#1 \\$processingResult of static method OpenEMR\\\\RestControllers\\\\RestControllerHelper\\:\\:handleProcessingResult\\(\\) expects OpenEMR\\\\Validators\\\\ProcessingResult, mixed given\\.$#',
74771-
'count' => 5,
74772-
'path' => __DIR__ . '/../../tests/Tests/RestControllers/HandleProcessingResultTest.php',
74773-
];
7477474774
$ignoreErrors[] = [
7477574775
'message' => '#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#',
7477674776
'count' => 18,

.phpstan/baseline/method.nonObject.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8381,6 +8381,26 @@
83818381
'count' => 1,
83828382
'path' => __DIR__ . '/../../tests/Tests/Isolated/Common/Uuid/UuidRegistryTest.php',
83838383
];
8384+
$ignoreErrors[] = [
8385+
'message' => '#^Cannot call method addData\\(\\) on mixed\\.$#',
8386+
'count' => 3,
8387+
'path' => __DIR__ . '/../../tests/Tests/Isolated/RestControllers/HandleProcessingResultTest.php',
8388+
];
8389+
$ignoreErrors[] = [
8390+
'message' => '#^Cannot call method addInternalError\\(\\) on mixed\\.$#',
8391+
'count' => 1,
8392+
'path' => __DIR__ . '/../../tests/Tests/Isolated/RestControllers/HandleProcessingResultTest.php',
8393+
];
8394+
$ignoreErrors[] = [
8395+
'message' => '#^Cannot call method getData\\(\\) on mixed\\.$#',
8396+
'count' => 1,
8397+
'path' => __DIR__ . '/../../tests/Tests/Isolated/RestControllers/HandleProcessingResultTest.php',
8398+
];
8399+
$ignoreErrors[] = [
8400+
'message' => '#^Cannot call method setValidationMessages\\(\\) on mixed\\.$#',
8401+
'count' => 1,
8402+
'path' => __DIR__ . '/../../tests/Tests/Isolated/RestControllers/HandleProcessingResultTest.php',
8403+
];
83848404
$ignoreErrors[] = [
83858405
'message' => '#^Cannot call method getHeader\\(\\) on mixed\\.$#',
83868406
'count' => 4,
@@ -8601,26 +8621,6 @@
86018621
'count' => 4,
86028622
'path' => __DIR__ . '/../../tests/Tests/RestControllers/FHIR/FhirPractitionerRestControllerTest.php',
86038623
];
8604-
$ignoreErrors[] = [
8605-
'message' => '#^Cannot call method addData\\(\\) on mixed\\.$#',
8606-
'count' => 3,
8607-
'path' => __DIR__ . '/../../tests/Tests/RestControllers/HandleProcessingResultTest.php',
8608-
];
8609-
$ignoreErrors[] = [
8610-
'message' => '#^Cannot call method addInternalError\\(\\) on mixed\\.$#',
8611-
'count' => 1,
8612-
'path' => __DIR__ . '/../../tests/Tests/RestControllers/HandleProcessingResultTest.php',
8613-
];
8614-
$ignoreErrors[] = [
8615-
'message' => '#^Cannot call method getData\\(\\) on mixed\\.$#',
8616-
'count' => 1,
8617-
'path' => __DIR__ . '/../../tests/Tests/RestControllers/HandleProcessingResultTest.php',
8618-
];
8619-
$ignoreErrors[] = [
8620-
'message' => '#^Cannot call method setValidationMessages\\(\\) on mixed\\.$#',
8621-
'count' => 1,
8622-
'path' => __DIR__ . '/../../tests/Tests/RestControllers/HandleProcessingResultTest.php',
8623-
];
86248624
$ignoreErrors[] = [
86258625
'message' => '#^Cannot call method getBody\\(\\) on mixed\\.$#',
86268626
'count' => 3,

.phpstan/baseline/missingType.property.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30751,6 +30751,11 @@
3075130751
'count' => 1,
3075230752
'path' => __DIR__ . '/../../tests/Tests/Isolated/Portal/PatientControllerSecurityTest.php',
3075330753
];
30754+
$ignoreErrors[] = [
30755+
'message' => '#^Property OpenEMR\\\\Tests\\\\Isolated\\\\RestControllers\\\\HandleProcessingResultTest\\:\\:\\$processingResult has no type specified\\.$#',
30756+
'count' => 1,
30757+
'path' => __DIR__ . '/../../tests/Tests/Isolated/RestControllers/HandleProcessingResultTest.php',
30758+
];
3075430759
$ignoreErrors[] = [
3075530760
'message' => '#^Property OpenEMR\\\\Tests\\\\Isolated\\\\Telemetry\\\\BackgroundTaskManagerStub\\:\\:\\$lastBinds has no type specified\\.$#',
3075630761
'count' => 1,
@@ -30771,11 +30776,6 @@
3077130776
'count' => 1,
3077230777
'path' => __DIR__ . '/../../tests/Tests/RestControllers/FacilityRestControllerTest.php',
3077330778
];
30774-
$ignoreErrors[] = [
30775-
'message' => '#^Property OpenEMR\\\\Tests\\\\RestControllers\\\\HandleProcessingResultTest\\:\\:\\$processingResult has no type specified\\.$#',
30776-
'count' => 1,
30777-
'path' => __DIR__ . '/../../tests/Tests/RestControllers/HandleProcessingResultTest.php',
30778-
];
3077930779
$ignoreErrors[] = [
3078030780
'message' => '#^Property OpenEMR\\\\Tests\\\\RestControllers\\\\PatientRestControllerTest\\:\\:\\$fixtureManager has no type specified\\.$#',
3078130781
'count' => 1,

.phpstan/baseline/staticMethod.deprecated.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@
207207
'count' => 3,
208208
'path' => __DIR__ . '/../../tests/Tests/Isolated/Common/Utils/RandomGenUtilsTest.php',
209209
];
210+
$ignoreErrors[] = [
211+
'message' => '#^Call to deprecated method handleProcessingResult\\(\\) of class OpenEMR\\\\RestControllers\\\\RestControllerHelper\\:
212+
use createProcessingResultResponse\\(\\) instead\\.$#',
213+
'count' => 5,
214+
'path' => __DIR__ . '/../../tests/Tests/Isolated/RestControllers/HandleProcessingResultTest.php',
215+
];
210216
$ignoreErrors[] = [
211217
'message' => '#^Call to deprecated method isType\\(\\) of class PHPUnit\\\\Framework\\\\Assert\\:
212218
https\\://github\\.com/sebastianbergmann/phpunit/issues/6052$#',
@@ -219,11 +225,5 @@
219225
'count' => 7,
220226
'path' => __DIR__ . '/../../tests/Tests/Isolated/Telemetry/TelemetryServiceTest.php',
221227
];
222-
$ignoreErrors[] = [
223-
'message' => '#^Call to deprecated method handleProcessingResult\\(\\) of class OpenEMR\\\\RestControllers\\\\RestControllerHelper\\:
224-
use createProcessingResultResponse\\(\\) instead\\.$#',
225-
'count' => 5,
226-
'path' => __DIR__ . '/../../tests/Tests/RestControllers/HandleProcessingResultTest.php',
227-
];
228228

229229
return ['parameters' => ['ignoreErrors' => $ignoreErrors]];

phpunit-isolated.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ This file configures the kind that does not require initialization.
3535
<php>
3636
<env name="ENV" value="test" />
3737
<ini name="error_reporting" value="-1"/>
38-
<!-- Disable database connections for isolated testing -->
39-
<server name="DISABLE_DATABASE" value="1"/>
4038
</php>
4139

4240
<source ignoreIndirectDeprecations="true">

tests/Tests/Unit/PasswordVerifyTest.php renamed to tests/Tests/Isolated/Common/Auth/PasswordVerifyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
1919
*/
2020

21-
namespace OpenEMR\Tests\Unit;
21+
namespace OpenEMR\Tests\Isolated\Common\Auth;
2222

2323
use OpenEMR\Common\Auth\AuthHash;
2424
use PHPUnit\Framework\TestCase;

tests/Tests/Unit/Common/Session/SessionUtilReadAndCloseTest.php renamed to tests/Tests/Isolated/Common/Session/SessionUtilReadAndCloseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
1515
*/
1616

17-
namespace OpenEMR\Tests\Unit\Common\Session;
17+
namespace OpenEMR\Tests\Isolated\Common\Session;
1818

1919
use OpenEMR\Common\Session\SessionUtil;
2020
use OpenEMR\Common\Session\SessionWrapperFactory;

tests/Tests/RestControllers/HandleProcessingResultTest.php renamed to tests/Tests/Isolated/RestControllers/HandleProcessingResultTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace OpenEMR\Tests\RestControllers;
3+
namespace OpenEMR\Tests\Isolated\RestControllers;
44

55
use OpenEMR\RestControllers\RestControllerHelper;
66
use OpenEMR\Validators\ProcessingResult;

0 commit comments

Comments
 (0)