Create the mock outside of the closure (php-5.3 needs this)