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


PHP AcceptanceTester::assertEquals方法代码示例

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


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

示例1: tryToTest

 public function tryToTest(AcceptanceTester $I)
 {
     $I->expectARequestToRemoteServiceWithAResponse(Phiremock::on(A::getRequest()->andUrl(Is::equalTo('/some/url')))->then(Respond::withStatusCode(203)->andBody('I am a response')));
     $response = file_get_contents('http://localhost:18080/some/url');
     $I->assertEquals('I am a response', $response);
     $I->seeRemoteServiceReceived(1, A::getRequest()->andUrl(Is::equalTo('/some/url')));
 }
开发者ID:mcustiel,项目名称:phiremock-codeception-extension,代码行数:7,代码来源:BasicTestCest.php

示例2: tryToTest

 public function tryToTest(\AcceptanceTester $I)
 {
     $I->expectRequest()->when()->methodIs('GET')->pathIs('/foo')->then()->body('mocked body')->end();
     $I->doNotExpectAnyOtherRequest();
     $response = file_get_contents('http://localhost:18080/foo');
     $I->assertEquals('mocked body', $response);
 }
开发者ID:mcustiel,项目名称:codeception-http-mock,代码行数:7,代码来源:WelcomeCest.php

示例3: likes

 public function likes(\AcceptanceTester $I)
 {
     $answer = App\Models\Answer::get()->random();
     $user = App\Models\User::get()->random();
     \Auth::login($user);
     $likes = $answer->likes->count();
     $I->wantTo('like answer');
     $I->amOnRoute('q', ['id' => $answer->question->id]);
     $I->see($answer->question->title);
     $c = $likes ? (int) $I->grabTextFrom('li#answer_' . $answer->id . ' a.btn_like .like_count') : 0;
     $I->assertEquals($likes, $c);
     $I->click('li#answer_' . $answer->id . ' a.btn_like');
     $I->amOnRoute('q', ['id' => $answer->question->id]);
     $answer = App\Models\Answer::find($answer->id);
     $I->assertEquals($likes + 1, $answer->likes->count());
 }
开发者ID:gultaj,项目名称:toster,代码行数:16,代码来源:LikesCest.php

示例4: unlikeComponent

 private function unlikeComponent(\AcceptanceTester $I)
 {
     codecept_debug('unlikeComponent');
     $I->wait($this->fill_placeholder_wait);
     $pre_like_count = $I->grabTextFrom('.likes-count');
     $I->click('.ion-ios-heart');
     $I->waitForElement('.ion-ios-heart-outline', 10);
     $post_like_count = $I->grabTextFrom('.likes-count');
     $I->assertNotEquals($pre_like_count, $post_like_count);
     $I->wait($this->send_to_server_wait);
     $I->reloadPage();
     $I->wait($this->fill_placeholder_wait);
     $reload_like_count = $I->grabTextFrom('.likes-count');
     $I->assertEquals($reload_like_count, $post_like_count);
 }
开发者ID:bbig979,项目名称:shoppyst,代码行数:15,代码来源:AppCest.php

示例5: unlikePostOnCard

 private function unlikePostOnCard(\AcceptanceTester $I)
 {
     $I->wantTo('unlike post on card');
     $I->amOnPage('/');
     // card
     $I->waitForElement('a.unlike-post[data-id="560"]', 10);
     $pre_like_count = $I->grabTextFrom('.like-post-count[data-id="560"]');
     $I->click('a.unlike-post[data-id="560"]');
     $I->waitForElementVisible('a.like-post[data-id="560"]', 10);
     $I->waitForElementNotVisible('a.unlike-post[data-id="560"]', 10);
     $post_like_count = $I->grabTextFrom('.like-post-count[data-id="560"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
     $I->amOnPage('/post/560');
     $I->waitForElement('.like-post-count[data-id="560"]', 10);
     $post_like_count = $I->grabTextFrom('.like-post-count[data-id="560"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
 }
开发者ID:bbig979,项目名称:shoppyst,代码行数:17,代码来源:TKPostCest.php

示例6: unlikePostOnCard

 private function unlikePostOnCard(\AcceptanceTester $I)
 {
     codecept_debug('unlikePostOnCard');
     $I->amOnPage('/' . $this->user_slug . '/postgroups/' . $this->postgroup_slug);
     // card
     $I->waitForElement('.btn.unlike-post[data-id="' . $this->post_id . '"]', 10);
     $pre_like_count = $I->grabTextFrom('.like-post-count[data-id="' . $this->post_id . '"]');
     $I->click('.btn.unlike-post[data-id="' . $this->post_id . '"]');
     $I->waitForElementVisible('.btn.like-post[data-id="' . $this->post_id . '"]', 10);
     $I->waitForElementNotVisible('.btn.unlike-post[data-id="' . $this->post_id . '"]', 10);
     $post_like_count = $I->grabTextFrom('.like-post-count[data-id="' . $this->post_id . '"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
     $I->amOnPage('/post/' . $this->post_id);
     $I->waitForElement('.like-post-count[data-id="' . $this->post_id . '"]', 10);
     $post_like_count = $I->grabTextFrom('.like-post-count[data-id="' . $this->post_id . '"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
 }
开发者ID:bbig979,项目名称:shoppyst,代码行数:17,代码来源:UserCest.php

示例7: countExecutionsWhenNoExpectationIsSet

 public function countExecutionsWhenNoExpectationIsSet(AcceptanceTester $I)
 {
     $I->sendDELETE('/__phiremock/executions');
     $I->sendGET('/potato');
     $I->seeResponseCodeIs(404);
     $I->sendGET('/potato');
     $count = $this->phiremock->countExecutions(A::getRequest()->andUrl(Is::equalTo('/potato')));
     $I->assertEquals(2, $count);
     $count = $this->phiremock->countExecutions(A::getRequest()->andUrl(Is::matching('~potato~')));
     $I->assertEquals(2, $count);
 }
开发者ID:mcustiel,项目名称:phiremock,代码行数:11,代码来源:ClientCest.php

示例8: date

 public function systeminfo_ログ表示(\AcceptanceTester $I)
 {
     $I->wantTo('EA0806-UC01-T01 ログ表示');
     // 表示
     $config = Fixtures::get('config');
     $I->amOnPage('/' . $config['admin_route'] . '/setting/system/log');
     $I->see('システム設定EC-CUBE ログ表示', '#main .page-header');
     $log = $I->grabValueFrom(['id' => 'admin_system_log_files']);
     $expect = "site_" . date('Y-m-d') . ".log";
     $I->assertEquals($expect, $log);
     $I->fillField(['id' => 'line-max'], '1');
     $I->click(['css' => '#form1 button']);
     $I->dontSeeElement(['css' => '#main .container-fluid .box table tbody tr:nth-child(2)']);
 }
开发者ID:nanasess,项目名称:eccube-codeception,代码行数:14,代码来源:EA08SysteminfoCest.php

示例9:

 public function product_商品詳細サムネイル(\AcceptanceTester $I)
 {
     $I->wantTo('EF0202-UC01-T03 商品詳細 サムネイル');
     $I->amOnPage('/products/detail/2');
     $config = Fixtures::get('test_config');
     // デフォルトサムネイル表示確認
     $img = $I->grabAttributeFrom('#item_photo_area .slick-active img', 'src');
     $I->assertEquals('http://' . $config['hostname'] . '/upload/save_image/cafe-1.jpg', $img, $img . ' が見つかりません');
     // 2個目のサムネイルクリック
     $I->click('#item_photo_area .slick-dots li:nth-child(2) button');
     $img = $I->grabAttributeFrom('#item_photo_area .slick-active img', 'src');
     $I->assertEquals('http://' . $config['hostname'] . '/upload/save_image/cafe-2.jpg', $img, $img . ' が見つかりません');
 }
开发者ID:nanasess,项目名称:eccube-codeception,代码行数:13,代码来源:EF02ProductCest.php

示例10: grabFromLastEmailTo

 /**
  * @depends sendEmails
  *
  * @param \AcceptanceTester $I
  */
 public function grabFromLastEmailTo(\AcceptanceTester $I)
 {
     $I->wantTo('Grab from last email to ' . $this->getToFirstAddress());
     $result = $I->grabFromLastEmailTo($this->getToFirstAddress(), '/Body ([_a-z0-9]+)/i');
     $I->assertEquals('Body ' . sqs('second'), $result, 'Can not find matches in email body');
 }
开发者ID:johnatannvmd,项目名称:codeception-mailchecker-module,代码行数:11,代码来源:BaseMailChecker.php

示例11: count

 public function product_商品一覧表示件数(\AcceptanceTester $I)
 {
     $I->wantTo('EF0201-UC04-T01 商品一覧ページ 表示件数');
     $I->amOnPage('/');
     // TOPページ>商品一覧(ヘッダーのいずれかのカテゴリを選択)へ遷移
     $I->moveMouseOver(['css' => '#category .category-nav li:nth-child(2)']);
     $I->wait(3);
     $I->click('#header #category ul li:nth-child(2) a');
     // 各商品のサムネイルが表示される
     $config = Fixtures::get('test_config');
     $productNum = $config['fixture_product_num'] + 2;
     $itemNum = $productNum >= 15 ? 15 : $productNum;
     $products = $I->grabMultiple('#item_list .product_item');
     $I->assertTrue(count($products) == $itemNum);
     // 表示件数の選択リストを変更する
     $I->selectOption(['css' => "#page_navi_top select[name = 'disp_number']"], '30件');
     // 変更された表示件数分が1画面に表示される
     $expected = $productNum >= 30 ? 30 : $productNum;
     $products = $I->grabMultiple('#item_list .product_item');
     $actual = count($products);
     $I->assertEquals($expected, $actual, $expected . ' と ' . $actual . ' が異なります');
 }
开发者ID:EC-CUBE,项目名称:eccube-codeception,代码行数:22,代码来源:EF02ProductCest.php


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