public function setup() { parent::setup(); if (!isset(self::$hasSetup)) { $wikibaseRepo = WikibaseRepo::getDefaultInstance(); $store = $wikibaseRepo->getEntityStore(); $prop = Property::newFromType('string'); $store->saveEntity($prop, 'EditEntityTestP56', $GLOBALS['wgUser'], EDIT_NEW); self::$idMap['%P56%'] = $prop->getId()->getSerialization(); self::$idMap['%StringProp%'] = $prop->getId()->getSerialization(); $prop = Property::newFromType('string'); $store->saveEntity($prop, 'EditEntityTestP72', $GLOBALS['wgUser'], EDIT_NEW); self::$idMap['%P72%'] = $prop->getId()->getSerialization(); $this->initTestEntities(array('Berlin'), self::$idMap); self::$idMap['%Berlin%'] = EntityTestHelper::getId('Berlin'); $p56 = self::$idMap['%P56%']; $berlinData = EntityTestHelper::getEntityOutput('Berlin'); self::$idMap['%BerlinP56%'] = $berlinData['claims'][$p56][0]['id']; $badge = new Item(); $store->saveEntity($badge, 'EditEntityTestQ42', $GLOBALS['wgUser'], EDIT_NEW); self::$idMap['%Q42%'] = $badge->getId()->getSerialization(); $badge = new Item(); $store->saveEntity($badge, 'EditEntityTestQ149', $GLOBALS['wgUser'], EDIT_NEW); self::$idMap['%Q149%'] = $badge->getId()->getSerialization(); $badge = new Item(); $store->saveEntity($badge, 'EditEntityTestQ32', $GLOBALS['wgUser'], EDIT_NEW); self::$idMap['%Q32%'] = $badge->getId()->getSerialization(); $wikibaseRepo->getSettings()->setSetting('badgeItems', array(self::$idMap['%Q42%'] => '', self::$idMap['%Q149%'] => '', 'Q99999' => '')); } self::$hasSetup = true; }