protected function getJsonForStaticLocation(Location $location, array $params, $iconUrl, $visitedIconUrl, Parser $parser) { $jsonObj = $location->getJSONObject($params['title'], $params['label'], $iconUrl, '', '', $visitedIconUrl); $jsonObj['title'] = $parser->parse($jsonObj['title'], $parser->getTitle(), new ParserOptions())->getText(); $jsonObj['text'] = $parser->parse($jsonObj['text'], $parser->getTitle(), new ParserOptions())->getText(); $hasTitleAndtext = $jsonObj['title'] !== '' && $jsonObj['text'] !== ''; $jsonObj['text'] = ($hasTitleAndtext ? '<b>' . $jsonObj['title'] . '</b><hr />' : $jsonObj['title']) . $jsonObj['text']; $jsonObj['title'] = strip_tags($jsonObj['title']); if ($params['pagelabel']) { $jsonObj['inlineLabel'] = Linker::link(Title::newFromText($jsonObj['title'])); } return $jsonObj; }
protected function assertHasJsonKeyWithValue(Location $polygon, $key, $value) { $json = $polygon->getJSONObject(); $this->assertArrayHasKey($key, $json); $this->assertEquals($value, $json[$key]); }