本文整理汇总了PHP中ApiTester::assertEquals方法的典型用法代码示例。如果您正苦于以下问题:PHP ApiTester::assertEquals方法的具体用法?PHP ApiTester::assertEquals怎么用?PHP ApiTester::assertEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiTester
的用法示例。
在下文中一共展示了ApiTester::assertEquals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: read
/**
* Preberem zapis
*
* @param ApiTester $I
* @depends create
*/
public function read(\ApiTester $I)
{
$ent = $I->successfullyGet($this->restUrl, $this->obj['id']);
$I->assertEquals($ent['sifra'], 'ZZ');
$I->assertEquals($ent['naziv'], 'uu');
$I->assertEquals($ent['opis'], 'zz');
}
示例2: readDatum
/**
* Preberem zapis in preverim vsa polja
*
* @depends create
* @param ApiTester $I
*/
public function readDatum(\ApiTester $I)
{
$ent = $I->successfullyGet($this->restUrl, $this->obj3['id']);
codecept_debug($ent);
$I->assertEquals($ent['zacetek'], '2009-09-14T00:00:00+0200');
//konec spremenjen v +0200
$ent = $I->successfullyGet($this->restUrl, $this->obj2['id']);
$I->assertEquals($ent['zacetek'], '2003-02-01T00:00:00+0100');
}
示例3: read
/**
* Preberem zapis in preverim vsa polja
*
* @depends create
* @param ApiTester $I
*/
public function read(\ApiTester $I)
{
$ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
codecept_debug($ent);
$I->assertGuid($ent['id']);
$I->assertEquals($ent['name'], 'TESTA');
$I->assertEquals($ent['description'], 'to je A');
$I->assertEquals($ent['builtIn'], false);
//sam določi
}
示例4: read
/**
* Preberem zapis in preverim vsa polja
*
* @depends create
* @param ApiTester $I
*/
public function read(\ApiTester $I)
{
$ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
$I->assertGuid($ent['id']);
$I->assertEquals($ent['oznaka'], 'AA');
$I->assertEquals($ent['naziv'], 'uu');
$I->assertEquals($ent['aktiven'], TRUE);
$I->assertEquals($ent['znacka'], TRUE);
$I->assertEquals($ent['ikona'], 'AA');
}
示例5: getDiscussions
public function getDiscussions(ApiTester $I)
{
$I->wantTo('get discussions via API');
$discussions = Factory::times(2)->create('Flarum\\Core\\Models\\Discussion');
$I->sendGET($this->endpoint);
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->expect('there are two discussions in the response');
$I->assertEquals(2, count($I->grabDataFromJsonResponse('discussions')));
$I->expect('the discussions exist');
$I->seeResponseContainsJson(['id' => (string) $discussions[0]->id, 'title' => $discussions[0]->title]);
$I->seeResponseContainsJson(['id' => (string) $discussions[1]->id, 'title' => $discussions[1]->title]);
}
示例6: createFirst
public function createFirst(ApiTester $I)
{
$I->createAndLoginUser();
$I->createProjectAndSetHeader();
$table_data = $I->createTable();
$table_id_no_decisions = $table_data->_id;
$table_data = $I->createTable();
$table_id_with_decisions = $table_data->_id;
$decision_table = $I->makeDecision($table_id_with_decisions);
$I->assertEquals('Approve', $decision_table->final_decision);
$I->sendGET('api/v1/admin/decisions?table_id=' . $table_id_no_decisions);
$I->seeResponseCodeIs(404);
# filter by table_id
$I->sendGET('api/v1/admin/decisions?table_id=' . $table_id_with_decisions);
$I->assertTableDecisionsForAdmin('decision', '$.data[*]');
foreach ($I->getResponseFields()->data as $item) {
$I->sendGET('api/v1/admin/decisions/' . $item->_id);
$I->assertTableDecisionsForAdmin();
}
$I->sendGET('api/v1/admin/decisions/123');
$I->seeResponseCodeIs(404);
$decision_data = $I->makeDecision($table_id_with_decisions, ['borrowers_phone_verification' => 'invalid', 'contact_person_phone_verification' => 'invalid', 'internal_credit_history' => 'invalid', 'employment' => false, 'property' => false]);
$I->assertEquals($table_data->variants[0]->default_decision, $decision_data->final_decision);
$I->sendGET('api/v1/admin/decisions');
$I->assertTableDecisionsForAdmin('decision', '$.data[*]');
$decisions = $I->getResponseFields()->data;
$I->assertEquals('invalid', $decisions[0]->request->borrowers_phone_verification);
$I->assertEquals('Positive', $decisions[1]->request->borrowers_phone_verification);
foreach ($I->getResponseFields()->data as $item) {
$I->sendGET('api/v1/admin/decisions/' . $item->_id);
$I->assertTableDecisionsForAdmin();
}
$I->loginConsumer($I->createConsumer());
$I->sendGET('api/v1/admin/decisions');
$I->seeResponseCodeIs(401);
}
示例7: read
/**
* Preberem abonma
*
* @param ApiTester $I
* @depends create
*/
public function read(\ApiTester $I)
{
$ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
codecept_debug($ent);
$I->assertEquals($ent['stPredstav'], 5);
$I->assertEquals($ent['stKuponov'], 55);
$I->assertEquals($ent['ime'], 'zz');
$I->assertEquals($ent['opis'], 'zz');
$I->assertEquals($ent['kapaciteta'], 444);
$I->assertEquals($ent['barva'], '#123456');
}
示例8: read
/**
* Preberem zapis in preverim vsa polja
*
* @depends create
* @param ApiTester $I
*/
public function read(\ApiTester $I)
{
$ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
codecept_debug($ent);
$I->assertGuid($ent['id']);
$I->assertEquals($ent['sifra'], '9000');
$I->assertEquals($ent['ime'], 'zz');
$I->assertEquals($ent['opis'], 'yy');
}
示例9: read
/**
* Preberem zapis in preverim vsa polja
*
* @depends create
* @param ApiTester $I
*/
public function read(\ApiTester $I)
{
$ent = $I->successfullyGet($this->restUrl, $this->obj['id']);
codecept_debug($ent);
$I->assertGuid($ent['id']);
$I->assertEquals($ent['sifra'], '99');
$I->assertEquals($ent['ime'], 'zz');
$I->assertEquals($ent['opis'], 'yy');
$I->assertEquals($ent['imeZenski'], 'yy');
$I->assertEquals($ent['podrocje'], 'umetnik');
$I->assertEquals($ent['sort'], 9999);
$I->assertTrue(isset($ent['funkcije']), "ali so funkcije");
$I->assertEquals(0, count($ent['funkcije']), "število funkcij");
}
示例10: read
/**
* Preberem zapis in preverim vsa polja
*
* @depends create
* @param ApiTester $I
*/
public function read(\ApiTester $I)
{
$ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
$I->assertNotEmpty($ent['id']);
$I->assertEquals($ent['celotnaVrednost'], 3.72);
$I->assertEquals($ent['nasDelez'], 3.72);
$I->assertEquals($ent['celotnaVrednostGostovSZ'], 3.11);
$dif = $ent['celotnaVrednost'] - $ent['celotnaVrednostGostovSZ'];
$I->assertEquals($ent['celotnaVrednostMat'], $ent['celotnaVrednost'] - $ent['celotnaVrednostGostovSZ'], "cel. vr. matič.");
$I->assertEquals($ent['zaproseno'], 1.22, "zaprošeno");
$I->assertEquals($ent['lastnaSredstva'], $ent['nasDelez'] - $ent['zaproseno'] - $ent['drugiJavni'] - $ent['vlozekGostitelja'], "lastna sredstva");
$I->assertEquals($ent['avtorskiHonorarji'], 1.24);
$I->assertEquals($ent['avtorskiHonorarjiSamoz'], 1.24);
$I->assertEquals($ent['tantieme'], 1.24);
$I->assertEquals($ent['materialni'], 1.24);
$I->assertEquals($ent['avtorskePravice'], 0);
// $I->assertEquals($ent['drugiViri'], 1.24);
$I->assertEquals($ent['vlozekGostitelja'], 1.24);
$I->assertEquals($ent['drugiJavni'], 1.24);
$I->assertEquals($ent['obiskDoma'], 1);
$I->assertEquals($ent['obiskKopr'], 1);
$I->assertEquals($ent['obiskGost'], 1);
$I->assertEquals($ent['obiskKoprGost'], 1);
$I->assertEquals($ent['obiskZamejo'], 1);
$I->assertEquals($ent['obiskKoprZamejo'], 1);
$I->assertEquals($ent['obiskInt'], 0, "obisk Int");
$I->assertEquals($ent['ponoviDoma'], 1);
$I->assertEquals($ent['ponoviKopr'], 1);
$I->assertEquals($ent['ponoviZamejo'], 1);
$I->assertEquals($ent['ponoviKoprZamejo'], 1);
$I->assertEquals($ent['ponoviGost'], 1);
$I->assertEquals($ent['ponoviKoprGost'], 1);
$I->assertEquals($ent['ponoviInt'], 0, "ponovi Int");
$I->assertEquals($ent['uprizoritev']['id'], $this->lookUprizoritev['id']);
$I->assertEquals($ent['tipProgramskeEnote'], $this->lookTipProgramskeEnote['id']);
$I->assertEquals($ent['sort'], 1, 'sort');
$I->assertEquals($ent['dokument'], null);
$I->assertEquals($ent['stZaposUmet'], 1);
$I->assertEquals($ent['stZaposDrug'], 1);
$I->assertEquals($ent['stHonorarnihZun'], 1);
$I->assertEquals($ent['stHonorarnihZunIgr'], 1);
$I->assertEquals($ent['stHonorarnihZunIgrTujJZ'], 1);
$I->assertEquals($ent['stHonorarnihZunSamoz'], 1);
}
示例11: read
/**
* Preberem zapis in preverim vsa polja
*
* @depends create
* @param ApiTester $I
*/
public function read(\ApiTester $I)
{
$ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
$I->assertNotEmpty($ent['id']);
$I->assertEquals($ent['sifra'], 'ZZ');
$I->assertEquals($ent['naziv'], 'yy');
$I->assertEquals($ent['koprodukcija'], FALSE);
$I->assertEquals($ent['maxFaktor'], 0.75);
$I->assertEquals($ent['maxVsi'], 0.86);
}
示例12: read
/**
* Preberem zapis in preverim vsa polja
*
* @depends create
* @param ApiTester $I
*/
public function read(\ApiTester $I)
{
$ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
$I->assertNotEmpty($ent['id']);
$I->assertEquals($ent['uprizoritev']['id'], $this->lookUprizoritev['id']);
$I->assertEquals($ent['krajGostovanja'], 'zz');
$I->assertEquals($ent['drzavaGostovanja'], $this->objDrzava1['id']);
$I->assertEquals($ent['ustanova'], 'zz');
$I->assertEquals($ent['datumGostovanja'], '2011-02-01T00:00:00+0100');
$I->assertEquals($ent['ponoviInt'], 9);
$I->assertEquals($ent['ponoviKoprInt'], 9);
$I->assertEquals($ent['obiskInt'], 9);
$I->assertEquals($ent['obiskKoprInt'], 9);
$I->assertEquals($ent['zaproseno'], 9.119999999999999, "izračunano zaprošeno");
$I->assertEquals($ent['celotnaVrednost'], 45.6);
$I->assertEquals($ent['nasDelez'], 45.6);
$I->assertEquals($ent['transportniStroski'], 9.119999999999999);
$I->assertEquals($ent['dnevPrvZad'], 9.119999999999999);
$I->assertEquals($ent['tantieme'], 9.119999999999999);
$I->assertEquals($ent['materialni'], 9.119999999999999);
$I->assertEquals($ent['avtorskePravice'], 0);
$I->assertEquals($ent['avtorskiHonorarji'], 9.119999999999999);
$I->assertEquals($ent['avtorskiHonorarjiSamoz'], 9.119999999999999);
$I->assertEquals($ent['vlozekGostitelja'], 2.34);
$I->assertEquals($ent['lastnaSredstva'], $ent['nasDelez'] - $ent['zaproseno'] - $ent['drugiJavni'] - $ent['vlozekGostitelja'], "lastna sredstva");
$I->assertEquals($ent['celotnaVrednostMat'], 0);
// $I->assertEquals($ent['drugiViri'], 9.12);
$I->assertEquals($ent['drugiJavni'], 9.119999999999999);
$I->assertEquals($ent['dokument'], NULL);
$I->assertEquals($ent['gostitelj']['id'], $this->lookPopa1['id']);
$I->assertEquals($ent['sort'], 1);
$I->assertEquals($ent['imaKoprodukcije'], TRUE);
}
示例13: read
/**
* Preberem zapis in preverim vsa polja
*
* @depends create
* @param ApiTester $I
*/
public function read(\ApiTester $I)
{
$ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
codecept_debug($ent);
$I->assertGuid($ent['id']);
$I->assertEquals($ent['ime'], 'aa');
$I->assertEquals($ent['komentar'], 'uu');
$I->assertEquals($ent['lastnik'], $this->lookUser2['id']);
$I->assertEquals($ent['javniDostop'], 'R', "javni dostop");
$I->assertEquals($ent['parent'], $this->lookMapa1['id']);
}
示例14: ApiTester
<?php
$I = new ApiTester($scenario);
$I->wantTo('Insert items and checkout');
/**
* @var array $item1
* @var array $item2
* @var int $order
*/
require "_AddItems.php";
$I->amGoingTo('checkout');
$I->sendPATCH('cart');
$I->seeCodeAndJson(200, ['id' => $order, 'total' => floatify($item1['final_price'] + $item2['final_price'])]);
$I->amGoingTo('verify the order was really ~closed~');
$I->sendGET('cart');
$I->assertEquals(sizeof(json_decode($I->grabResponse())->items), 0, 'verify the cart is now empty');
示例15: readZReadBrezReadZaEntitetoLasnika
/**
* Preberem zapis in preverim vsa polja
*
* @depends createZWriteZWriteZaEntitetoLasnika
* @param ApiTester $I
*/
public function readZReadBrezReadZaEntitetoLasnika(\ApiTester $I)
{
$I->amHttpAuthenticated(\IfiTest\AuthPage::$rudi, \IfiTest\AuthPage::$rudiPass);
$resp = $I->failToGet($this->restUrl, $this->obj1['id']);
codecept_debug($resp);
$I->assertEquals(100099, $resp[0][0]['code']);
$resp = $I->failToGetList($this->restUrl . "?lastnik=" . $this->lookUprizoritev5['id'], []);
codecept_debug($resp);
$I->assertEquals(1001140, $resp[0]['code']);
}