Fix CircleCI tests

Fix tests by using variable scope, since PhantomJS doesn't have `Function.prototype.bind` ([#10522](https://github.com/ariya/phantomjs/issues/10522)).

Merry Christmas! :)