���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home/rickpfrv/wiki.craftaro.com/tests/qunit/resources/mediawiki.api/mediawiki.api.messages.test.js
���ѧ٧ѧ�
( function () { QUnit.module( 'mediawiki.api.messages', QUnit.newMwEnvironment( { beforeEach: function () { this.server = this.sandbox.useFakeServer(); this.server.respondImmediately = true; } } ) ); QUnit.test( '.getMessages()', function ( assert ) { this.server.respondWith( /ammessages=foo%7Cbaz/, [ 200, { 'Content-Type': 'application/json' }, '{ "query": { "allmessages": [' + '{ "name": "foo", "content": "Foo bar" },' + '{ "name": "baz", "content": "Baz Quux" }' + '] } }' ] ); return new mw.Api().getMessages( [ 'foo', 'baz' ] ).then( function ( messages ) { assert.deepEqual( messages, { foo: 'Foo bar', baz: 'Baz Quux' } ); } ); } ); // Make sure we properly handle a string and don't try to slice it in the handling for // multiple messages. The alphabet has 26 letters, so twice that is 52, if we don't // switch the string to an array of one the slice() call would remove the last two letters var longStringKey = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'; QUnit.test( '.getMessages() with a long string', function ( assert ) { var requestRegex = new RegExp( 'ammessages=' + longStringKey ); this.server.respondWith( requestRegex, [ 200, { 'Content-Type': 'application/json' }, '{ "query": { "allmessages": [' + '{ "name": "' + longStringKey + '", "content": "SomeRandomValue" }' + '] } }' ] ); return new mw.Api().getMessages( longStringKey ).then( function ( messages ) { var expected = {}; expected[ longStringKey ] = 'SomeRandomValue'; assert.deepEqual( messages, expected ); } ); } ); }() );
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0.41 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�