Added tests for this.stub() restoration