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