mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-77989 testing: Add test file isolation helper
When we deprecate the use of a file, we often include tests which ensure that the legacy behaviour is maintained. There are also legacy uses in the community where people would like to use the deprecated API for a period. The issue that we face is that, if the deprecated file is included once, then it will be included for all other, unrelated, tests. This means that other tests may not detect cases where the deprecated file was included. We can solve these cases by running the test that performs the inclusion in a deprecated process. This means that the inclusion is only performed in that isolated process, and other unrelated tests do not include the file. However, we also then need to detect which files which are including the file and which we do not know about. This change introduces: - an override to the TestCase::setInIsolation method to define a constant when the test is running in isolation - a new function that a file can call when it is included, to make sure that the test process was isolated, where there is any test.
- Loading branch information
1 parent
f7d7ad7
commit 1a53cbb
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters