For preg_quote to work reliably, you must pass the delimiter you are using for your regular expression. In many places we were failing to do that.
1/ type/match/tests/walkthrough_test.php - tests are failing randomly, looks like some weird randomisation is going on there - see TODOs 2/ type/multianswer/tests/upgradelibnewqe_test.php contains invalid expected value - see TODO