Henning Snater has submitted this change and it was merged. Change subject: Fixed DataValues JS tests broken in Ib52694b932b5f9bdc0949b357960917c06593ef2 ......................................................................
Fixed DataValues JS tests broken in Ib52694b932b5f9bdc0949b357960917c06593ef2 Also renamed getObject into getConstructor in the tests for correctness. Change-Id: I9c1e18ee55a905b5d9d29f32be22cc883653d3cc --- M DataValues/tests/qunit/DataValue.tests.js M DataValues/tests/qunit/DataValues.tests.js M DataValues/tests/qunit/values/BoolValue.tests.js M DataValues/tests/qunit/values/MonolingualTextValue.tests.js M DataValues/tests/qunit/values/MultilingualTextValue.tests.js M DataValues/tests/qunit/values/NumberValue.tests.js M DataValues/tests/qunit/values/StringValue.tests.js M DataValues/tests/qunit/values/UnknownValue.tests.js 8 files changed, 27 insertions(+), 26 deletions(-) Approvals: Henning Snater: Verified; Looks good to me, approved diff --git a/DataValues/tests/qunit/DataValue.tests.js b/DataValues/tests/qunit/DataValue.tests.js index 685997f..1ea5477 100644 --- a/DataValues/tests/qunit/DataValue.tests.js +++ b/DataValues/tests/qunit/DataValue.tests.js @@ -29,13 +29,13 @@ getConstructorArguments: dv.util.abstractMember, /** - * Returns the dataValue object to be tested (ie dv.StringValue). + * Returns the dataValue constructor to be tested (ie dv.StringValue). * * @since 0.1 * - * @return dv.DataValue + * @return Function */ - getObject: dv.util.abstractMember, + getConstructor: dv.util.abstractMember, /** * Returns the dataValue object to be tested (ie dv.StringValue). @@ -48,13 +48,14 @@ */ getInstance: function( constructorArguments ) { var self = this, - DataValueInstance = function( constructorArguments ) { - self.getObject().apply( this, constructorArguments ); + OriginalConstructor = self.getConstructor(), + DataValueConstructor = function( constructorArguments ) { + OriginalConstructor.apply( this, constructorArguments ); }; - $.extend( DataValueInstance.prototype, this.getObject().prototype ); + DataValueConstructor.prototype = OriginalConstructor.prototype; - return new DataValueInstance( constructorArguments ); + return new DataValueConstructor( constructorArguments ); }, /** diff --git a/DataValues/tests/qunit/DataValues.tests.js b/DataValues/tests/qunit/DataValues.tests.js index 819b1f2..633f91b 100644 --- a/DataValues/tests/qunit/DataValues.tests.js +++ b/DataValues/tests/qunit/DataValues.tests.js @@ -7,7 +7,7 @@ ( function( dv, $, QUnit ) { 'use strict'; - // Fix for msot of our tests no having the number of required assertions. + // Fix for most of our tests no having the number of required assertions. // This is required since I214b3d4 got merged into core. // TODO: figure out some non-global alternative to deal with this. QUnit.config.requireExpects = false; diff --git a/DataValues/tests/qunit/values/BoolValue.tests.js b/DataValues/tests/qunit/values/BoolValue.tests.js index 2364dc4..7e06325 100644 --- a/DataValues/tests/qunit/values/BoolValue.tests.js +++ b/DataValues/tests/qunit/values/BoolValue.tests.js @@ -6,7 +6,7 @@ * @licence GNU GPL v2+ * @author Jeroen De Dauw < jeroended...@gmail.com > */ -( function( dv, $, QUnit, undefined ) { +( function( dv, $, QUnit ) { 'use strict'; var PARENT = dv.tests.DataValueTest; @@ -21,9 +21,9 @@ dv.tests.BoolValueTest = dv.util.inherit( PARENT, { /** - * @see dv.tests.DataValueTest.getObject + * @see dv.tests.DataValueTest.getConstructor */ - getObject: function() { + getConstructor: function() { return dv.BoolValue; }, diff --git a/DataValues/tests/qunit/values/MonolingualTextValue.tests.js b/DataValues/tests/qunit/values/MonolingualTextValue.tests.js index 7700bc4..7487e79 100644 --- a/DataValues/tests/qunit/values/MonolingualTextValue.tests.js +++ b/DataValues/tests/qunit/values/MonolingualTextValue.tests.js @@ -6,7 +6,7 @@ * @licence GNU GPL v2+ * @author Jeroen De Dauw < jeroended...@gmail.com > */ -( function( dv, $, QUnit, undefined ) { +( function( dv, $, QUnit ) { 'use strict'; var PARENT = dv.tests.DataValueTest; @@ -21,9 +21,9 @@ dv.tests.MonolingualTextValueTest = dv.util.inherit( PARENT, { /** - * @see dv.tests.DataValueTest.getObject + * @see dv.tests.DataValueTest.getConstructor */ - getObject: function() { + getConstructor: function() { return dv.MonolingualTextValue; }, diff --git a/DataValues/tests/qunit/values/MultilingualTextValue.tests.js b/DataValues/tests/qunit/values/MultilingualTextValue.tests.js index 8d3b827..0b8d275 100644 --- a/DataValues/tests/qunit/values/MultilingualTextValue.tests.js +++ b/DataValues/tests/qunit/values/MultilingualTextValue.tests.js @@ -6,7 +6,7 @@ * @licence GNU GPL v2+ * @author Jeroen De Dauw < jeroended...@gmail.com > */ -( function( dv, $, QUnit, undefined ) { +( function( dv, $, QUnit ) { 'use strict'; var PARENT = dv.tests.DataValueTest; @@ -21,9 +21,9 @@ dv.tests.MultilingualTextValueTest = dv.util.inherit( PARENT, { /** - * @see dv.tests.DataValueTest.getObject + * @see dv.tests.DataValueTest.getConstructor */ - getObject: function() { + getConstructor: function() { return dv.MultilingualTextValue; }, diff --git a/DataValues/tests/qunit/values/NumberValue.tests.js b/DataValues/tests/qunit/values/NumberValue.tests.js index 4c50e18..708bedf 100644 --- a/DataValues/tests/qunit/values/NumberValue.tests.js +++ b/DataValues/tests/qunit/values/NumberValue.tests.js @@ -6,7 +6,7 @@ * @licence GNU GPL v2+ * @author Daniel Werner < danwe...@web.de > */ -( function( dv, $, QUnit, undefined ) { +( function( dv, $, QUnit ) { 'use strict'; var PARENT = dv.tests.DataValueTest; @@ -21,9 +21,9 @@ dv.tests.NumberValueTest = dv.util.inherit( PARENT, { /** - * @see dv.tests.DataValueTest.getObject + * @see dv.tests.DataValueTest.getConstructor */ - getObject: function() { + getConstructor: function() { return dv.NumberValue; }, diff --git a/DataValues/tests/qunit/values/StringValue.tests.js b/DataValues/tests/qunit/values/StringValue.tests.js index c1c5cc4..4566f22 100644 --- a/DataValues/tests/qunit/values/StringValue.tests.js +++ b/DataValues/tests/qunit/values/StringValue.tests.js @@ -6,7 +6,7 @@ * @licence GNU GPL v2+ * @author Jeroen De Dauw < jeroended...@gmail.com > */ -( function( dv, $, QUnit, undefined ) { +( function( dv, $, QUnit ) { 'use strict'; var PARENT = dv.tests.DataValueTest; @@ -21,9 +21,9 @@ dv.tests.StringValueTest = dv.util.inherit( PARENT, { /** - * @see dv.tests.DataValueTest.getObject + * @see dv.tests.DataValueTest.getConstructor */ - getObject: function() { + getConstructor: function() { return dv.StringValue; }, diff --git a/DataValues/tests/qunit/values/UnknownValue.tests.js b/DataValues/tests/qunit/values/UnknownValue.tests.js index c57cf9f..86df3b2 100644 --- a/DataValues/tests/qunit/values/UnknownValue.tests.js +++ b/DataValues/tests/qunit/values/UnknownValue.tests.js @@ -6,7 +6,7 @@ * @licence GNU GPL v2+ * @author Jeroen De Dauw < jeroended...@gmail.com > */ -( function( dv, $, QUnit, undefined ) { +( function( dv, $, QUnit ) { 'use strict'; var PARENT = dv.tests.DataValueTest; @@ -21,9 +21,9 @@ dv.tests.UnknownValueTest = dv.util.inherit( PARENT, { /** - * @see dv.tests.DataValueTest.getObject + * @see dv.tests.DataValueTest.getConstructor */ - getObject: function() { + getConstructor: function() { return dv.UnknownValue; }, -- To view, visit https://gerrit.wikimedia.org/r/55893 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9c1e18ee55a905b5d9d29f32be22cc883653d3cc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Daniel Werner <daniel.wer...@wikimedia.de> Gerrit-Reviewer: Henning Snater <henning.sna...@wikimedia.de> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits