protected function setUp() { parent::setUp(); $this->clearExtraLifecycleHandlers(); // We don't want local config getting in the way of testing whether or // not our permissions implementation works well. // This will load default $wgGroupPermissions + Flow settings, so we can // test if permissions work well, regardless of any custom config. global $IP, $wgFlowGroupPermissions; $wgGroupPermissions = array(); require "{$IP}/includes/DefaultSettings.php"; $wgGroupPermissions = array_merge_recursive($wgGroupPermissions, $wgFlowGroupPermissions); $this->setMwGlobals('wgGroupPermissions', $wgGroupPermissions); // When external store is used, data is written to "blobs" table, which // by default doesn't exist - let's just not use externalstorage in test $this->setMwGlobals('wgFlowExternalStore', false); // load actions object $this->actions = Container::get('flow_actions'); // block a user $blockedUser = $this->blockedUser(); $this->block = new Block(array('address' => $blockedUser->getName(), 'user' => $blockedUser->getID())); $this->block->insert(); // ensure that block made it into the database wfGetDB(DB_MASTER)->commit(__METHOD__, 'flush'); }
protected function tearDown() { parent::tearDown(); foreach ($this->tablesUsed as $table) { $this->db->delete($table, '*', __METHOD__); } }
public function setUp() { parent::setUp(); if (!class_exists('EchoEvent')) { $this->markTestSkipped(); return; } }
protected function setUp() { parent::setUp(); // create a dummy filter $this->setMwGlobals('wgSpamRegex', array('/http:\\/\\/spam/')); // create spam filter $this->spamFilter = new SpamRegex(); if (!$this->spamFilter->enabled()) { $this->markTestSkipped('SpamRegex not enabled'); } }
protected function setUp() { parent::setUp(); // recent changes isn't fully setup here, just skip it $this->clearExtraLifecycleHandlers(); // generate a post with multiple revisions $revision = $this->generateObject(array('rev_content' => 'first revision')); $this->store($revision); $revision = $this->generateObject(array('rev_content' => 'second revision', 'rev_change_type' => 'edit-post', 'rev_parent_id' => $revision->getRevisionId()->getBinary(), 'tree_rev_descendant_id' => $revision->getPostId()->getBinary(), 'rev_type_id' => $revision->getPostId()->getBinary())); $this->store($revision); $revision = $this->generateObject(array('rev_content' => 'third revision', 'rev_change_type' => 'edit-post', 'rev_parent_id' => $revision->getRevisionId()->getBinary(), 'tree_rev_descendant_id' => $revision->getPostId()->getBinary(), 'rev_type_id' => $revision->getPostId()->getBinary())); $this->store($revision); }
public function setUp() { parent::setUp(); // create a workflow & revision associated with it $this->revision = $this->generateObject(); $this->workflow = $this->workflows[$this->revision->getCollectionId()->getAlphadecimal()]; $this->storage = Container::get('storage'); $this->extractor = Container::get('reference.extractor'); $this->recorder = Container::get('reference.recorder'); $this->updater = Container::get('reference.updater.links-tables'); // Check for Parsoid try { Utils::convert('html', 'wikitext', 'Foo', $this->workflow->getOwnerTitle()); } catch (WikitextException $excep) { $this->markTestSkipped('Parsoid not enabled'); } // These tests don't provide sufficient data to properly run all listeners $this->clearExtraLifecycleHandlers(); }
protected function tearDown() { parent::tearDown(); }
protected function tearDown() { \MessageCache::singleton()->disable(); parent::tearDown(); }