protected function setUp()
 {
     parent::setUp();
     self::$users['ApiQueryWatchlistIntegrationTestUser'] = $this->getMutableTestUser();
     self::$users['ApiQueryWatchlistIntegrationTestUser2'] = $this->getMutableTestUser();
     $this->doLogin('ApiQueryWatchlistIntegrationTestUser');
 }
示例#2
0
 function setUp()
 {
     parent::setUp();
     $this->language_name = "Welch";
     $this->code = "we";
     $this->second_name = "WELCH";
 }
示例#3
0
 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->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();
 }
示例#6
0
 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();
 }
 function setUp()
 {
     global $wgTitleBlacklistSources;
     parent::setUp();
     $this->doLogin();
     $wgTitleBlacklistSources = array(array('type' => 'file', 'src' => __DIR__ . '/testSource'));
 }
示例#8
0
 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');
 }
示例#9
0
 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 tearDown()
 {
     global $wgGatherAllowPublicWatchlist;
     $wgGatherAllowPublicWatchlist = false;
     $this->db->delete('gather_list_item', '*');
     $this->db->delete('gather_list', '*');
     parent::tearDown();
 }
 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';
 }
示例#12
0
 protected function setUp()
 {
     parent::setUp();
     $this->setMwGlobals(array('wgEnableUploads' => true, 'wgAllowCopyUploads' => true));
     if (wfLocalFile('UploadFromUrlTest.png')->exists()) {
         $this->deleteFile('UploadFromUrlTest.png');
     }
 }
 public function __construct()
 {
     parent::__construct();
     $this->_params = array('email' => '*****@*****.**', 'password' => '123456', 'device_id' => '123456');
     $this->_method = 'POST';
     $this->_uri = 'api/register';
     $this->_models = array('User');
 }
示例#14
0
 public function setUp()
 {
     parent::setUp();
     $user = new User();
     $user->email = $this->_params['email'];
     $user->password = $this->_params['password'];
     $user->fb_id = '123456';
     $user->save();
 }
示例#15
0
 /**
  * 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();
 }
示例#17
0
 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();
 }
 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);
     }
 }
示例#19
0
 public function setUp()
 {
     global $wgEnableUploads, $wgAllowCopyUploads;
     parent::setUp();
     $wgEnableUploads = true;
     $wgAllowCopyUploads = true;
     wfSetupSession();
     if (wfLocalFile('UploadFromUrlTest.png')->exists()) {
         $this->deleteFile('UploadFromUrlTest.png');
     }
 }
示例#20
0
 protected function setUp()
 {
     global $wgServer, $wgDisableAuthManager;
     parent::setUp();
     self::$apiUrl = $wgServer . wfScript('api');
     ApiQueryInfo::resetTokenCache();
     // tokens are invalid because we cleared the session
     self::$users = ['sysop' => static::getTestSysop(), 'uploader' => static::getTestUser()];
     $this->setMwGlobals(['wgAuth' => $wgDisableAuthManager ? new AuthPlugin() : new MediaWiki\Auth\AuthManagerAuthPlugin(), 'wgRequest' => new FauxRequest([]), 'wgUser' => self::$users['sysop']->user]);
     $this->apiContext = new ApiTestContext();
 }
示例#21
0
 protected function setUp()
 {
     global $wgServer;
     parent::setUp();
     self::$apiUrl = $wgServer . wfScript('api');
     ApiQueryInfo::resetTokenCache();
     // tokens are invalid because we cleared the session
     self::$users = array('sysop' => new TestUser('Apitestsysop', 'Api Test Sysop', '*****@*****.**', array('sysop')), 'uploader' => new TestUser('Apitestuser', 'Api Test User', '*****@*****.**', array()));
     $this->setMwGlobals(array('wgAuth' => new StubObject('wgAuth', 'AuthPlugin'), 'wgRequest' => new FauxRequest(array()), 'wgUser' => self::$users['sysop']->user));
     $this->apiContext = new ApiTestContext();
 }
示例#22
0
 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();
 }
示例#23
0
 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();
 }
示例#24
0
 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;
     }]]);
 }
示例#25
0
 function setUp()
 {
     global $wgContLang, $wgAuth, $wgMemc, $wgRequest, $wgUser, $wgServer;
     parent::setUp();
     self::$apiUrl = $wgServer . wfScript('api');
     $wgMemc = new EmptyBagOStuff();
     $wgContLang = Language::factory('en');
     $wgAuth = new StubObject('wgAuth', 'AuthPlugin');
     $wgRequest = new FauxRequest(array());
     self::$users = array('sysop' => new ApiTestUser('Apitestsysop', 'Api Test Sysop', '*****@*****.**', array('sysop')), 'uploader' => new ApiTestUser('Apitestuser', 'Api Test User', '*****@*****.**', array()));
     $wgUser = self::$users['sysop']->user;
 }
示例#26
0
 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 teardown()
 {
     global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang;
     unset($wgExtraNamespaces[12312]);
     unset($wgExtraNamespaces[12313]);
     unset($wgNamespaceContentModels[12312]);
     unset($wgContentHandlers["testing"]);
     MWNamespace::getCanonicalNamespaces(true);
     # reset namespace cache
     $wgContLang->resetNamespaces();
     # reset namespace cache
     parent::teardown();
 }
示例#28
0
 protected function apiRequest($format, $params, $data = null)
 {
     $data = parent::doApiRequest($params, $data, true);
     $module = $data[3];
     $printer = $module->createPrinterByName($format);
     $printer->setUnescapeAmps(false);
     $printer->initPrinter(false);
     ob_start();
     $printer->execute();
     $out = ob_get_clean();
     $printer->closePrinter();
     return $out;
 }
 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();
 }
示例#30
0
 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();
 }