本文整理汇总了PHP中ApiTestCase类的典型用法代码示例。如果您正苦于以下问题:PHP ApiTestCase类的具体用法?PHP ApiTestCase怎么用?PHP ApiTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ApiTestCase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: setUp
function setUp()
{
parent::setUp();
$this->language_name = "Welch";
$this->code = "we";
$this->second_name = "WELCH";
}
开发者ID:robertblackwell,项目名称:srmn,代码行数:7,代码来源:LanguagesTest.php
示例3: setUp
public function setUp()
{
parent::setUp();
$this->setUpData();
$this->setUpRating();
$this->setUpProfile();
$user = new User();
$user->email = '[email protected]';
$user->password = '123456';
$user->save();
$follow_id = User::where('email', '[email protected]')->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
示例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:MediaWiki-stable,项目名称:1.26.1,代码行数:10,代码来源:ApiTestCaseUpload.php
示例6: setUp
public function setUp()
{
parent::setUp();
$this->setUpData();
$this->setUpProfile();
$user = new User();
$user->email = '[email protected]';
$user->password = '123456';
$user->save();
$other_user = User::where('email', '[email protected]')->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
示例7: 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
示例8: 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
示例9: 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
示例10: tearDown
protected function tearDown()
{
global $wgGatherAllowPublicWatchlist;
$wgGatherAllowPublicWatchlist = false;
$this->db->delete('gather_list_item', '*');
$this->db->delete('gather_list', '*');
parent::tearDown();
}
开发者ID:joakin,项目名称:mediawiki-extensions-Gather,代码行数:8,代码来源:GatherTest.php
示例11: 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
示例12: 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
示例13: __construct
public function __construct()
{
parent::__construct();
$this->_params = array('email' => '[email protected]', 'password' => '123456', 'device_id' => '123456');
$this->_method = 'POST';
$this->_uri = 'api/register';
$this->_models = array('User');
}
开发者ID:anht37,项目名称:winelover_server,代码行数:8,代码来源:RegisterUserTest.php
示例14: 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
示例15: 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
示例16: 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
示例17: setUp
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();
}
开发者ID:anht37,项目名称:winelover_server,代码行数:11,代码来源:LikeTest.php
示例18: setUp
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);
}
}
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:11,代码来源:ApiRevisionDeleteTest.php
示例19: setUp
public function setUp()
{
global $wgEnableUploads, $wgAllowCopyUploads;
parent::setUp();
$wgEnableUploads = true;
$wgAllowCopyUploads = true;
wfSetupSession();
if (wfLocalFile('UploadFromUrlTest.png')->exists()) {
$this->deleteFile('UploadFromUrlTest.png');
}
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:11,代码来源:UploadFromUrlTest.php
示例20: setUp
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();
}
开发者ID:claudinec,项目名称:galan-wiki,代码行数:11,代码来源:ApiTestCase.php
注:本文中的ApiTestCase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论