Файловый менеджер - Редактировать - /var/www/html/mediawiki-1.43.1/tests/qunit/resources/mediawiki.api/mediawiki.api.category.test.js
Ðазад
QUnit.module( 'mediawiki.api.category', ( hooks ) => { let server; hooks.beforeEach( function () { server = this.sandbox.useFakeServer(); server.respondImmediately = true; } ); QUnit.test( '.getCategoriesByPrefix()', async ( assert ) => { server.respondWith( [ 200, { 'Content-Type': 'application/json' }, '{ "query": { "allpages": [ ' + '{ "title": "Category:Food" },' + '{ "title": "Category:Fool Supermarine S.6" },' + '{ "title": "Category:Fools" }' + '] } }' ] ); const matches = await new mw.Api().getCategoriesByPrefix( 'Foo' ); assert.deepEqual( matches, [ 'Food', 'Fool Supermarine S.6', 'Fools' ] ); } ); QUnit.test( '.isCategory("")', async ( assert ) => { server.respondWith( /titles=$/, [ 200, { 'Content-Type': 'application/json' }, '{"batchcomplete":true}' ] ); const response = await new mw.Api().isCategory( '' ); assert.strictEqual( response, false ); } ); QUnit.test( '.isCategory("#")', async ( assert ) => { server.respondWith( /titles=%23$/, [ 200, { 'Content-Type': 'application/json' }, '{"batchcomplete":true,"query":{"normalized":[{"fromencoded":false,"from":"#","to":""}]}}' ] ); const response = await new mw.Api().isCategory( '#' ); assert.strictEqual( response, false ); } ); QUnit.test( '.isCategory("mw:")', async ( assert ) => { server.respondWith( /titles=mw%3A$/, [ 200, { 'Content-Type': 'application/json' }, '{"batchcomplete":true,"query":{"interwiki":[{"title":"mw:","iw":"mw"}]}}' ] ); const response = await new mw.Api().isCategory( 'mw:' ); assert.strictEqual( response, false ); } ); QUnit.test( '.isCategory("|")', async ( assert ) => { server.respondWith( /titles=%1F%7C$/, [ 200, { 'Content-Type': 'application/json' }, '{"batchcomplete":true,"query":{"pages":[{"title":"|","invalidreason":"The requested page title contains invalid characters: \\"|\\".","invalid":true}]}}' ] ); const response = await new mw.Api().isCategory( '|' ); assert.strictEqual( response, false ); } ); QUnit.test( '.getCategories("")', async ( assert ) => { server.respondWith( /titles=$/, [ 200, { 'Content-Type': 'application/json' }, '{"batchcomplete":true}' ] ); const response = await new mw.Api().getCategories( '' ); assert.strictEqual( response, false ); } ); QUnit.test( '.getCategories("#")', async ( assert ) => { server.respondWith( /titles=%23$/, [ 200, { 'Content-Type': 'application/json' }, '{"batchcomplete":true,"query":{"normalized":[{"fromencoded":false,"from":"#","to":""}]}}' ] ); const response = await new mw.Api().getCategories( '#' ); assert.strictEqual( response, false ); } ); QUnit.test( '.getCategories("mw:")', async ( assert ) => { server.respondWith( /titles=mw%3A$/, [ 200, { 'Content-Type': 'application/json' }, '{"batchcomplete":true,"query":{"interwiki":[{"title":"mw:","iw":"mw"}]}}' ] ); const response = await new mw.Api().getCategories( 'mw:' ); assert.strictEqual( response, false ); } ); QUnit.test( '.getCategories("|")', async ( assert ) => { server.respondWith( /titles=%1F%7C$/, [ 200, { 'Content-Type': 'application/json' }, '{"batchcomplete":true,"query":{"pages":[{"title":"|","invalidreason":"The requested page title contains invalid characters: \\"|\\".","invalid":true}]}}' ] ); const response = await new mw.Api().getCategories( '|' ); assert.strictEqual( response, false ); } ); } );
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка