本文整理汇总了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);
}
示例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
示例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('/');
示例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');
示例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');