当前位置: 首页>>代码示例>>PHP>>正文


PHP ApiTestCase::setUp方法代码示例

本文整理汇总了PHP中ApiTestCase::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP ApiTestCase::setUp方法的具体用法?PHP ApiTestCase::setUp怎么用?PHP ApiTestCase::setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ApiTestCase的用法示例。


在下文中一共展示了ApiTestCase::setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $this->setUpData();
     $this->setUpProfile();
     $user = new User();
     $user->email = 'test_1@gmail.com';
     $user->password = '123456';
     $user->save();
     $other_user = User::where('email', 'test_1@gmail.com')->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();
 }
开发者ID:anht37,项目名称:winelover_server,代码行数:25,代码来源:ProfileTest.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     $this->setUpData();
     $this->setUpRating();
     $this->setUpProfile();
     $user = new User();
     $user->email = 'test_1@gmail.com';
     $user->password = '123456';
     $user->save();
     $follow_id = User::where('email', 'test_1@gmail.com')->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();
 }
开发者ID:anht37,项目名称:winelover_server,代码行数:27,代码来源:RankingTest.php

示例3: setUp

 function setUp()
 {
     parent::setUp();
     $this->doLogin();
     $this->createRepo();
     $this->commonApiData = array('repo' => 'Test', 'format' => 'json');
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:7,代码来源:CodeReviewApiTest.php

示例4: setUp

 function setUp()
 {
     parent::setUp();
     $this->arr = $this->setUpStringArray();
     $json_str = json_encode($this->arr);
     file_put_contents(__DIR__ . "/data.json", $json_str);
 }
开发者ID:robertblackwell,项目名称:srmn,代码行数:7,代码来源:StringsUploadTest.php

示例5: setUp

 /**
  * Fixture -- run before every test
  */
 protected function setUp()
 {
     parent::setUp();
     $this->setMwGlobals(array('wgEnableUploads' => true, 'wgEnableAPI' => true));
     wfSetupSession();
     $this->clearFakeUploads();
 }
开发者ID:Habatchii,项目名称:wikibase-for-mediawiki,代码行数:10,代码来源:ApiTestCaseUpload.php

示例6: setUp

 function setUp()
 {
     global $wgTitleBlacklistSources;
     parent::setUp();
     $this->doLogin();
     $wgTitleBlacklistSources = array(array('type' => 'file', 'src' => __DIR__ . '/testSource'));
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:7,代码来源:ApiQueryTitleBlacklistTest.php

示例7: setUp

 protected function setUp()
 {
     parent::setUp();
     self::$users['ApiQueryWatchlistIntegrationTestUser'] = $this->getMutableTestUser();
     self::$users['ApiQueryWatchlistIntegrationTestUser2'] = $this->getMutableTestUser();
     $this->doLogin('ApiQueryWatchlistIntegrationTestUser');
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:7,代码来源:ApiQueryWatchlistIntegrationTest.php

示例8: setUp

 function setUp()
 {
     parent::setUp();
     $this->language_name = "Welch";
     $this->code = "we";
     $this->second_name = "WELCH";
 }
开发者ID:robertblackwell,项目名称:srmn,代码行数:7,代码来源:LanguagesTest.php

示例9: setup

 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');
 }
开发者ID:Ryan-Nolan,项目名称:boxbilling,代码行数:8,代码来源:ServiceTest.php

示例10: setUp

 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();
 }
开发者ID:anht37,项目名称:winelover_server,代码行数:8,代码来源:LogoutTest.php

示例11: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->setMwGlobals(array('wgEnableUploads' => true, 'wgAllowCopyUploads' => true));
     if (wfLocalFile('UploadFromUrlTest.png')->exists()) {
         $this->deleteFile('UploadFromUrlTest.png');
     }
 }
开发者ID:paladox,项目名称:2,代码行数:8,代码来源:UploadFromUrlTest.php

示例12: setUp

 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';
 }
开发者ID:anht37,项目名称:winelover_server,代码行数:8,代码来源:RegisterDeviceTest.php

示例13: setUp

 public function setUp()
 {
     parent::setUp();
     $user = new User();
     $user->email = $this->_params['email'];
     $user->password = $this->_params['password'];
     $user->fb_id = '123456';
     $user->save();
 }
开发者ID:anht37,项目名称:winelover_server,代码行数:9,代码来源:LoginTest.php

示例14: setUp

 /**
  * Fixture -- run before every test
  */
 public function setUp()
 {
     global $wgEnableUploads, $wgEnableAPI;
     parent::setUp();
     $wgEnableUploads = true;
     $wgEnableAPI = true;
     wfSetupSession();
     $this->clearFakeUploads();
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:12,代码来源:ApiTestCaseUpload.php

示例15: setUp

 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();
 }
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:10,代码来源:ApiQueryMessageGroupsTest.php


注:本文中的ApiTestCase::setUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。