Is it possible to create a function to be executed before/after each test runs? Maybe something like this.
For example, it is needed to
- revert to a clean db before each test
- clear application cache or registry settings after each test
Of course, it is possible to create 2 functions and call them explicitly in the first and the last line of each script. However it would be suitable to define them once in one place, so that they are invoked for each test automatically.