當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ApiTester::assertEmpty方法代碼示例

本文整理匯總了PHP中ApiTester::assertEmpty方法的典型用法代碼示例。如果您正苦於以下問題:PHP ApiTester::assertEmpty方法的具體用法?PHP ApiTester::assertEmpty怎麽用?PHP ApiTester::assertEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ApiTester的用法示例。


在下文中一共展示了ApiTester::assertEmpty方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: function

$I->amGoingTo('Get an existent organization on different information levels');
$get_org = function ($level, $orgs) use($I) {
    $I->amGoingTo("Request Org {$level} information");
    $query = $level ? '?level=' . $level : '';
    $I->sendGET('dev/organization/' . $orgs[array_rand($orgs)] . $query);
    $I->seeResponseCodeIs(200);
    $org = json_decode($I->grabResponse(), true);
    $I->assertTrue(is_numeric($org['size']), 'has total of members');
    $I->assertTrue(is_array($org['members']), 'has list of members');
    $I->assertGreaterThanOrEqual(1, $org['size'], 'organization has at least one member');
    $I->assertEquals(sizeof($org['members']), $org['size'], 'total is correctly calculated');
    $I->assertTrue(is_string($org['members'][0]['username']), 'first member has "username"');
    return $org;
};
$org = $get_org('basic', $orgs);
$I->assertEmpty($org['members'][0]['name']);
$I->assertEmpty($org['members'][0]['repos']);
$I->assertEmpty($org['members'][0]['rate']);
$org = $get_org(null, $orgs);
$I->assertTrue(is_string($org['members'][0]['name']));
$I->assertTrue(is_numeric($org['members'][0]['repos']));
$I->assertEmpty($org['members'][0]['rate']);
$org = $get_org('user', $orgs);
$I->assertTrue(is_string($org['members'][0]['name']));
$I->assertTrue(is_numeric($org['members'][0]['repos']));
$I->assertEmpty($org['members'][0]['rate']);
$org = $get_org('complete', $sm_orgs);
//using only small orgs ensures we won't timeout from taking forever at GitHub
$I->assertTrue(is_string($org['members'][0]['name']));
$I->assertTrue(is_numeric($org['members'][0]['repos']));
$I->assertTrue(is_numeric($org['members'][0]['rate']));
開發者ID:igorsantos07,項目名稱:developer-shop,代碼行數:31,代碼來源:OrganizationCept.php

示例2: dodajDvaTrr

 /**
  * Dodam dva računa 
  * 
  * @depends  create
  * @param ApiTester $I
  */
 public function dodajDvaTrr(\ApiTester $I)
 {
     $data = ['oseba' => $this->obj1['id'], "banka" => "NLB", "stevilka" => "123456677", "swift" => "sdfsdf", "bic" => "xxxx"];
     $this->objtrr = $trr = $I->successfullyCreate($this->trrUrl, $data);
     $I->assertEquals('NLB', $trr['banka']);
     $I->assertEquals($trr['oseba'], $this->obj1['id'], "osebe ni");
     $I->assertEmpty($trr['popa'], "popa mora biti null");
     $data['stevilka'] = "44444444";
     $data['banka'] = "NKBM";
     $trr = $this->trr = $I->successfullyCreate($this->trrUrl, $data);
     $I->assertEquals('44444444', $trr['stevilka'], "stevilka  drugi trr");
 }
開發者ID:ifigenija,項目名稱:server,代碼行數:18,代碼來源:OsebaCest.php


注:本文中的ApiTester::assertEmpty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。