本文整理汇总了PHP中ApiTester::assertGreaterThanOrEqual方法的典型用法代码示例。如果您正苦于以下问题:PHP ApiTester::assertGreaterThanOrEqual方法的具体用法?PHP ApiTester::assertGreaterThanOrEqual怎么用?PHP ApiTester::assertGreaterThanOrEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiTester
的用法示例。
在下文中一共展示了ApiTester::assertGreaterThanOrEqual方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: winTipsCountGreaterOrEqualToWinTips
public function winTipsCountGreaterOrEqualToWinTips(ApiTester $I)
{
$I->sendGET($this->endpoint . SOURCE);
$tips = $I->grabDataFromResponseByJsonPath('$.tips');
foreach ($tips[0] as $tip) {
$I->assertGreaterThanOrEqual($tip['win_tips'], $tip['win_tips_count'], 'win_tips_count less than win_tips');
}
}
示例2: ApiTester
<?php
$I = new ApiTester($scenario);
$I->wantTo('Check for hot tips');
//$I->amHttpAuthenticated('service_user', '123456');
////$I->haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded');
$I->sendGet('http://api.invendium-dev.com/?source=');
//$I->seeResponseCodeIs(200);
//$I->seeResponseIsJson();
//$I->seeResponseContains('odds_rounded');
//$I->seeResponseContains('popularity');
//$I->seeResponseContainsJson(array('sport' => 'Football'));
$tips = $I->grabDataFromResponseByJsonPath('$.tips');
$array = array();
foreach ($tips[0] as $tip) {
$array[] = $tip['sportname'];
}
$array = array_count_values($array);
foreach ($array as $sportname => $tipsCount) {
$I->assertGreaterThanOrEqual('10', $tipsCount, "{$sportname} has only {$tipsCount} tips.");
}
示例3: ApiTester
$sm_orgs = Fixtures::get('small_orgs');
$I = new ApiTester($scenario);
$I->wantTo('list of developers of an organization');
$I->amGoingTo('Get a non-existent organization');
$I->sendGET('dev/organization/' . $faker->lexify('??????????'));
$I->seeResponseCodeIs(404);
$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']));