(#14872) Add tests for the fix

This patch adds tests for the fix for the issue described in ticket #14872
(PMT ignoring the --environment option when installing/uninstalling modules).