32 use MediaWikiCoversValidator;
46 $normalizer->normalizePageName( $pageName,
'https://www.wikidata.org/w/api.php' )
57 '{"batchcomplete":"","query":{"pages":{"129":{"pageid":129,"ns":0,'
58 .
'"title":"Q1","contentmodel":"wikibase-item","pagelanguage":"en",'
59 .
'"pagelanguagehtmlcode":"en","pagelanguagedir":"ltr",'
60 .
'"touched":"2016-06-23T05:11:21Z","lastrevid":350004448,"length":58001}}}}'
62 'Q404 redirects to Q395' => [
65 '{"batchcomplete":"","query":{"redirects":[{"from":"Q404","to":"Q395"}],"pages"'
66 .
':{"601":{"pageid":601,"ns":0,"title":"Q395","contentmodel":"wikibase-item",'
67 .
'"pagelanguage":"en","pagelanguagehtmlcode":"en","pagelanguagedir":"ltr",'
68 .
'"touched":"2016-06-23T08:00:20Z","lastrevid":350021914,"length":60108}}}}'
70 'D converted to Д (Latin to Cyrillic) (taken from kkwiki)' => [
73 '{"batchcomplete":"","query":{"converted":[{"from":"D","to":"\u0414"}],'
74 .
'"pages":{"510541":{"pageid":510541,"ns":0,"title":"\u0414",'
75 .
'"contentmodel":"wikitext","pagelanguage":"kk","pagelanguagehtmlcode":"kk",'
76 .
'"pagelanguagedir":"ltr","touched":"2015-11-22T09:16:18Z",'
77 .
'"lastrevid":2373618,"length":3501}}}}'
82 '{"batchcomplete":"","query":{"pages":{"-1":{"ns":0,"title":"Q0",'
83 .
'"missing":"","contentmodel":"wikibase-item","pagelanguage":"en",'
84 .
'"pagelanguagehtmlcode":"en","pagelanguagedir":"ltr"}}}}'
89 '{"batchcomplete":"","query":{"pages":{"-1":{"title":"{{",'
90 .
'"invalidreason":"The requested page title contains invalid '
91 .
'characters: \"{\".","invalid":""}}}}'
93 'error on get' => [
false,
'ABC',
false ]
110 public static function get( $url,
$options = [], $caller = __METHOD__ ) {
111 PHPUnit_Framework_Assert::assertInternalType(
'string', $url );
112 PHPUnit_Framework_Assert::assertInternalType(
'array',
$options );
113 PHPUnit_Framework_Assert::assertInternalType(
'string', $caller );