public function setUp() { parent::setUp(); $this->setUpData(); $this->setUpProfile(); $user = new User(); $user->email = '*****@*****.**'; $user->password = '******'; $user->save(); $other_user = User::where('email', '*****@*****.**')->first()->user_id; $profile = new Profile(); $profile->user_id = $other_user; $profile->follower_count = '4'; $profile->following_count = '7'; $profile->rate_count = '6'; $profile->comment_count = '9'; $profile->scan_count = '15'; $profile->last_name = 'pro2'; $profile->first_name = 'user other 1'; $profile->save(); $follow = new Follow(); $follow->from_id = $this->_user_id; $follow->to_id = $other_user; $follow->save(); }
public function setUp() { parent::setUp(); $this->setUpData(); $this->setUpRating(); $this->setUpProfile(); $user = new User(); $user->email = '*****@*****.**'; $user->password = '******'; $user->save(); $follow_id = User::where('email', '*****@*****.**')->first()->user_id; $profile = new Profile(); $profile->user_id = $follow_id; $profile->follower_count = '13'; $profile->following_count = '2'; $profile->rate_count = '32'; $profile->comment_count = '12'; $profile->scan_count = '8'; $profile->last_name = 'pro3'; $profile->first_name = 'user login'; $profile->save(); $follow = new Follow(); $follow->id = 1; $follow->from_id = $this->_user_id; $follow->to_id = $follow_id; $follow->save(); }
function setUp() { parent::setUp(); $this->doLogin(); $this->createRepo(); $this->commonApiData = array('repo' => 'Test', 'format' => 'json'); }
function setUp() { parent::setUp(); $this->arr = $this->setUpStringArray(); $json_str = json_encode($this->arr); file_put_contents(__DIR__ . "/data.json", $json_str); }
/** * Fixture -- run before every test */ protected function setUp() { parent::setUp(); $this->setMwGlobals(array('wgEnableUploads' => true, 'wgEnableAPI' => true)); wfSetupSession(); $this->clearFakeUploads(); }
function setUp() { global $wgTitleBlacklistSources; parent::setUp(); $this->doLogin(); $wgTitleBlacklistSources = array(array('type' => 'file', 'src' => __DIR__ . '/testSource')); }
protected function setUp() { parent::setUp(); self::$users['ApiQueryWatchlistIntegrationTestUser'] = $this->getMutableTestUser(); self::$users['ApiQueryWatchlistIntegrationTestUser2'] = $this->getMutableTestUser(); $this->doLogin('ApiQueryWatchlistIntegrationTestUser'); }
function setUp() { parent::setUp(); $this->language_name = "Welch"; $this->code = "we"; $this->second_name = "WELCH"; }
public function setup() { parent::setUp(); $data = array('id' => 'paidsupport', 'type' => 'mod'); $this->api_admin->extension_activate($data); $hookService = $this->di['mod_service']('hook'); $hookService->batchConnect('paidsupport'); }
public function setUp() { parent::setUp(); $this->call('POST', ApiResponse::$API_LIST['login'], array('data' => json_encode(array('fb_id' => '123456')))); $login = Login::all()->last(); $this->_params['session_id'] = $login->session_id; $this->client->restart(); }
protected function setUp() { parent::setUp(); $this->setMwGlobals(array('wgEnableUploads' => true, 'wgAllowCopyUploads' => true)); if (wfLocalFile('UploadFromUrlTest.png')->exists()) { $this->deleteFile('UploadFromUrlTest.png'); } }
public function setUp() { $this->_models = array('Device'); parent::setUp(); $this->_params = array('auth_key' => '123456', 'device_id' => '123456', 'platform' => Device::IOS); $this->_method = 'POST'; $this->_uri = 'api/push_notification'; }
public function setUp() { parent::setUp(); $user = new User(); $user->email = $this->_params['email']; $user->password = $this->_params['password']; $user->fb_id = '123456'; $user->save(); }
/** * Fixture -- run before every test */ public function setUp() { global $wgEnableUploads, $wgEnableAPI; parent::setUp(); $wgEnableUploads = true; $wgEnableAPI = true; wfSetupSession(); $this->clearFakeUploads(); }
protected function setUp() { parent::setUp(); global $wgHooks; $this->setMwGlobals(array('wgHooks' => $wgHooks, 'wgTranslateTranslationServices' => array())); $wgHooks['TranslatePostInitGroups'] = array(array($this, 'getTestGroups')); $mg = MessageGroups::singleton(); $mg->setCache(wfGetCache('hash')); $mg->recache(); }
protected function setUp() { // Needs to be before setup since this gets cached $this->mergeMwGlobalArrayValue('wgGroupPermissions', array('sysop' => array('deleterevision' => true))); parent::setUp(); // Make a few edits for us to play with for ($i = 1; $i <= 5; $i++) { self::editPage(self::$page, MWCryptRand::generateHex(10), 'summary'); $this->revs[] = Title::newFromText(self::$page)->getLatestRevID(Title::GAID_FOR_UPDATE); } }
public function setUp() { parent::setUp(); $this->setUpData(); $this->setUpRating(); $wishlist = new Wishlist(); $wishlist->id = 1; $wishlist->user_id = $this->_user_id; $wishlist->wine_unique_id = "1_2009"; $wishlist->save(); }
public function setUp() { global $wgEnableUploads, $wgAllowCopyUploads; parent::setUp(); $wgEnableUploads = true; $wgAllowCopyUploads = true; wfSetupSession(); if (wfLocalFile('UploadFromUrlTest.png')->exists()) { $this->deleteFile('UploadFromUrlTest.png'); } }
public function setUp() { parent::setUp(); $this->setUpData(); $this->setUpRating(); $like = new Like(); $like->id = 1; $like->user_id = $this->_user_id; $like->rating_id = 1; $like->save(); }
public function setUp() { parent::setUp(); $this->setUpData(); $this->setUpRating(); $winenote = new Winenote(); $winenote->id = 1; $winenote->user_id = $this->_user_id; $winenote->wine_unique_id = '1_2009'; $winenote->note = "this is note 1"; $winenote->save(); }
protected function setUp() { parent::setUp(); $this->doLogin(); // Setup apiquerytestiw: as interwiki prefix $this->setMwGlobals('wgHooks', ['InterwikiLoadPrefix' => [function ($prefix, &$data) { if ($prefix == 'apiquerytestiw') { $data = ['iw_url' => 'wikipedia']; } return false; }]]); }
protected function setUp() { parent::setUp(); if (!self::$wlUsers) { foreach (array('GatherML', 'GatherML2', 'GatherWML', 'GatherWML2', 'GatherWlOnly', 'GatherWlOnly2', 'GatherE1', 'GatherE2', 'GatherE3') as $name) { self::$wlUsers[$name] = new TestUser($name); } } self::$users = array_merge(self::$users, self::$wlUsers); global $wgGatherAllowPublicWatchlist; $wgGatherAllowPublicWatchlist = false; }
public function setUp() { $this->_params = array('email' => '*****@*****.**'); $this->_method = 'POST'; $this->_uri = 'api/forgot_password'; $this->_models = array('User'); parent::setUp(); $user = new User(); $user->email = $this->_params['email']; $user->password = '******'; $user->fb_id = '123456'; $user->save(); }
public function setUp() { parent::setUp(); $this->setUpData(); $this->setUpRating(); $this->setUpProfile(); $comment = new Comment(); $comment->id = 1; $comment->user_id = $this->_user_id; $comment->rating_id = 1; $comment->content = "this is comment test"; $comment->save(); }
public function setUp() { global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; parent::setUp(); $wgExtraNamespaces[12312] = 'Dummy'; $wgExtraNamespaces[12313] = 'Dummy_talk'; $wgNamespaceContentModels[12312] = "testing"; $wgContentHandlers["testing"] = 'DummyContentHandlerForTesting'; MWNamespace::getCanonicalNamespaces(true); # reset namespace cache $wgContLang->resetNamespaces(); # reset namespace cache $this->doLogin(); }
public function setUp() { parent::setUp(); $this->setUpData(); $wine_note = new Winenote(); $wine_note->wine_unique_id = "1_2009"; $wine_note->user_id = $this->_user_id; $wine_note->note = "this is note test"; $wine_note->save(); $follow = new Follow(); $follow->from_id = $this->_user_id; $follow->to_id = "3620a42d-fcbb-45eb-b3a5-36cada1b77b7"; $follow->save(); }
public function setUp() { parent::setUp(); $this->setUpData(); $this->setUpRating(); $user = new User(); $user->email = '*****@*****.**'; $user->password = '******'; $user->save(); $follow_id = User::where('email', '*****@*****.**')->first()->user_id; $follow = new Follow(); $follow->id = 1; $follow->from_id = $this->_user_id; $follow->to_id = $follow_id; $follow->save(); }
function setUp() { $this->user_token = "USERTOKEN"; $this->context = new \App\Context(); $this->sql = $this->context->getMysqlInstance(); parent::setUp(); // create a project $pvalues = ['name' => 'project3', 'organization_name' => 'robertblackwell', 'description' => 'just for testing translations CRUD']; $result = $this->requester->request("Data.Project.create", [$pvalues]); $this->assertGoodResponse($result, 200); $values = $this->extractApiResult($result); $this->projectObject = new \VO\Project($values); // create a string $this->string = "thisisthestring-ZZZZZZZZ"; $svalues = ['string' => $this->string, 'comment' => 'just for testing translations crud', 'project_id' => $this->projectObject->id, 'project_name' => $this->projectObject->name, 'web' => 1, 'tmpl' => 1, 'mobile' => 1, 'crawler' => 1]; $result = $this->requester->request("Data.String.create", [$svalues]); $this->assertGoodResponse($result, 200); $values = $this->extractApiResult($result); $this->stringObject = new \VO\String($values); // Get a list of languages $this->en = $this->getLanguage("en"); $this->fr = $this->getLanguage("fr"); $this->es = $this->getLanguage("es"); $this->de = $this->getLanguage("de"); $this->projectObject = $this->addToProject($this->projectObject, $this->en); $this->projectObject = $this->addToProject($this->projectObject, $this->fr); $this->projectObject = $this->addToProject($this->projectObject, $this->es); $this->projectObject = $this->addToProject($this->projectObject, $this->de); $this->assertTrue(is_array($this->projectObject->languages)); $this->assertEquals(count($this->projectObject->languages), 4); $this->makeANewtranslation($this->en); $this->makeANewtranslation($this->fr); //var_dump($this->projectObject); return; // var_dump($this->stringObject); // exit(); $this->project = $this->projectObject->name; $this->project_id = $this->projectObject->id; $this->hash = $this->stringObject->hash; $this->string_id = $this->stringObject->id; $this->language_id = 11; $this->translation = "thisisthetranslationZZZZZZZ"; $this->second_translation = "thisistheSECONDtranslationYYYYYYYY"; }
protected function setUp() { global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; parent::setUp(); $this->setMwGlobals(array('wgExtraNamespaces' => $wgExtraNamespaces, 'wgNamespaceContentModels' => $wgNamespaceContentModels, 'wgContentHandlers' => $wgContentHandlers, 'wgContLang' => $wgContLang)); $wgExtraNamespaces[12312] = 'Dummy'; $wgExtraNamespaces[12313] = 'Dummy_talk'; $wgExtraNamespaces[12314] = 'DummyNonText'; $wgExtraNamespaces[12315] = 'DummyNonText_talk'; $wgNamespaceContentModels[12312] = "testing"; $wgNamespaceContentModels[12314] = "testing-nontext"; $wgContentHandlers["testing"] = 'DummyContentHandlerForTesting'; $wgContentHandlers["testing-nontext"] = 'DummyNonTextContentHandler'; MWNamespace::getCanonicalNamespaces(true); # reset namespace cache $wgContLang->resetNamespaces(); # reset namespace cache $this->doLogin(); }
function setUp() { // $this->context = new \App\Context(); // $this->sql = $this->context->getMysqlInstance(); parent::setUp(); $result = $this->requester->request("Data.Project.getProjectByName", ['robertblackwell', 'project1']); $this->assertGoodResponse($result, 200); $values = $this->extractApiResult($result); $values['languages'] = null; $this->projectObject = new \VO\Project($values); $this->language_id = 11; $this->translation = "thisisatranslation"; $this->user_token = "USERTOKEN"; $this->string = "thisisthestringSTRING"; $s = new \DM\Strings(); $this->hash = $s->hashString("robertblackwell", "project1", $this->string); $this->comment = 'this is a comment about a string'; $this->second_comment = 'this is SECOND comment about a string'; }