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


PHP FunctionalTester::expect方法代碼示例

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


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

示例1: authAsAdmin

 /**
  * @param \FunctionalTester $I
  */
 protected function authAsAdmin(\FunctionalTester $I)
 {
     $I->amOnPage(AuthorizationPage::$LOGOUT_URL);
     $I->amOnPage(AuthorizationPage::$LOGIN_URL);
     $I->fillField(AuthorizationPage::$USERNAME_FIELD, AuthorizationPage::$USERNAME);
     $I->fillField(AuthorizationPage::$PASSWORD_FIELD, AuthorizationPage::$PASSWORD);
     $I->click(AuthorizationPage::$SUBMIT_BUTTON);
     $I->expect(AuthorizationPage::$EXPECT_SUCCESS_LOGIN);
     $I->amOnPage(AuthorizationPage::$DASHBOARD_URL);
     $I->see(AuthorizationPage::$SEE_ELEMENT_ON_DASHBOARD);
 }
開發者ID:TeodorSolvic,項目名稱:Symfony2-Base-Instance,代碼行數:14,代碼來源:AdminAuthBase.php

示例2:

$I->haveSection();
// Created "Our company" section
$sections = $I->haveSections();
// Random sections
// And
$I->amOnPage('admin/sections');
// Then
$I->seeElement('input', ['name' => 'search']);
// When
$I->fillField('search', 'company');
$I->selectOption('published', '1');
// And
$I->click('Filter sections');
// Then
$I->seeCurrentUrlEquals('/admin/sections?search=company&published=1&menu=');
$I->expect('not to see the our company record');
// Then
$I->see('There are no sections, please create the first one');
$I->dontSee('Our company', 'td.name');
$I->seeInField('search', 'company');
// When
$I->selectOption('published', '0');
$I->selectOption('menu', '0');
// And
$I->click('Filter sections');
// Then
$I->see('There are no sections, please create the first one');
$I->dontSee('Our company', 'td.name');
// When
$I->selectOption('menu', '1');
// And
開發者ID:heroseven,項目名稱:cms,代碼行數:31,代碼來源:FilterSectionsCept.php

示例3: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->wantTo('redirect back using /back route');
$I->amOnPage('/');
$I->amOnPage('/back');
$I->expect('I am redirected back to /');
$I->seeCurrentUrlEquals('/');
開發者ID:jenky,項目名稱:laravel-api-starter,代碼行數:8,代碼來源:BackCept.php

示例4: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->am('a CMS admin');
$I->wantTo('paginate the sections results');
$I->amGoingTo('Go to page 1');
// When
$sections = $I->haveSections(16);
// And
$I->amOnPage('/admin/sections');
// Then
$I->see('There are 16 sections, showing page 1 of 2');
$I->expectTo('see the first section');
$I->see($sections->first()->name, 'tbody tr:first-child td.name');
$I->expect('not to see the last section');
$I->dontSee($sections->last()->name);
$I->expectTo('see the page 2 link');
$I->see('2', '.pagination a');
$I->amGoingTo('go to page 2');
// When
$I->click('2', '.pagination a');
// Then
$I->expectTo('see the pagination parameter in the URL');
$I->seeCurrentUrlEquals('/admin/sections?page=2');
$I->expect('not to see the first section');
$I->dontSee($sections->first()->name);
$I->expectTo('see the last section');
$I->see($sections->last()->name);
$I->expectTo('See the section #15 as first item on page 2');
$I->see($sections->get(15)->name, 'tbody tr:first-child td.name');
$I->amGoingTo('go back to page 1');
開發者ID:heroseven,項目名稱:cms,代碼行數:31,代碼來源:PaginateSectionsCept.php

示例5: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->am('a CMS admin');
$I->wantTo('filter and paginate the section list');
// When
$sections = $I->haveSections(90);
// Random sections
// And
$I->amOnPage('admin/sections');
$I->selectOption('published', '1');
$I->click('Filter sections');
$I->click('2', '.pagination a');
// Then
$I->expectTo('see published sections');
$I->see('Published', 'td');
$I->expect('not to see draft sections');
$I->dontSee('Draft', 'td');
開發者ID:heroseven,項目名稱:cms,代碼行數:18,代碼來源:SearchPaginatedCept.php


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