Make sure we don't use objects by ref in setMwGlobals
authoraddshore <addshorewiki@gmail.com>
Wed, 5 Mar 2014 13:25:07 +0000 (14:25 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 5 Mar 2014 18:31:49 +0000 (18:31 +0000)
commit6f5ea67f7fa8643368eeb0438f890582c8bed8e6
tree93e434533ffb878aa8d063500b010b05d49e6ac8
parentbc38e5851447dae099e0cd7a4e4203029ad2a0c8
Make sure we don't use objects by ref in setMwGlobals

If we copy am object by ref into our temporary array
then this doesn't really make this method very useful
as the same object would be restored, with any changes
after the test has run.

Thus objects should be cloned when being dumped in
here, we use unserialize() and serialize() instead as
we would also want to clone the objects within the
object to avoid changes in there!

These is no point in adding an if is_object call so
we just serialize and deserialize everything!

Change-Id: I5e4ef114405888932014edae6b44afc6ee2c4863
tests/phpunit/MediaWikiTestCase.php