本文整理汇总了PHP中FunctionalTester::submitForm方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::submitForm方法的具体用法?PHP FunctionalTester::submitForm怎么用?PHP FunctionalTester::submitForm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTester
的用法示例。
在下文中一共展示了FunctionalTester::submitForm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkCorrectChangePassword
public function checkCorrectChangePassword(FunctionalTester $I)
{
$I->submitForm('#login-form', $this->loginFormParams('test-user@example.com', '123123'));
$I->click('My Account');
$I->submitForm('#change-password-form', $this->resetPasswordFormParams('123456', '123456'));
$I->see('Password has been updated.');
}
示例2: createUser
public function createUser(FunctionalTester $I)
{
$I->amOnRoute('site/login');
$I->submitForm($this->loginFormId, $this->loginFormParams('admin@example.org', '123123'));
$I->amOnRoute('/admin/user/create');
$I->see('Create User');
$I->submitForm($this->createUserFormId, $this->createUserFormParams('created-user', 'created-user@example.com', '123123'));
$I->seeRecord('app\\models\\UserModel', ['username' => 'created-user', 'email' => 'created-user@example.com']);
}
示例3: submitFormSuccessfully
public function submitFormSuccessfully(\FunctionalTester $I)
{
$I->submitForm('#contact-form', ['ContactForm[name]' => 'tester', 'ContactForm[email]' => 'tester@example.com', 'ContactForm[subject]' => 'test subject', 'ContactForm[body]' => 'test content', 'ContactForm[verifyCode]' => 'testme']);
$I->seeEmailIsSent();
$I->dontSeeElement('#contact-form');
$I->see('Thank you for contacting us. We will respond to you as soon as possible.');
}
示例4: checkValidLogin
public function checkValidLogin(FunctionalTester $I)
{
$I->submitForm('#login-form', $this->formParams('admin@example.org', '123123'));
$I->see('Logout (admin)', 'form button[type=submit]');
$I->dontSeeLink('Login');
$I->dontSeeLink('Signup');
}
示例5: it_validates_required_fields
public function it_validates_required_fields(FunctionalTester $I)
{
//For coverage
$I->amOnRoute(RegisterPage::$ROUTE);
$I->submitForm(RegisterPage::$formId, [], 'Register');
$I->see('The username field is required.');
$I->see('The email field is required.');
$I->see('The password field is required.');
$I->dontSee('The name field is required.');
}
示例6: checkAdminPanel
public function checkAdminPanel(FunctionalTester $I)
{
$I->submitForm($this->formId, $this->formParams('admin@example.org', '123123'));
$I->see('Logout (admin)', 'form button[type=submit]');
$I->seeLink('Administration');
$I->click('Administration');
$I->see('Users');
$I->seeLink('CMS');
$I->seeLink('RBAC');
$I->seeLink('Settings Storage');
$I->seeLink('Cron Schedule Log');
}
示例7: addNote
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function addNote(FunctionalTester $I)
{
$I->am('Admin User');
$I->wantTo('add new note to a project');
$admin = $I->createUser(1, 4);
$I->amLoggedAs($admin);
$project = $I->createProject(1);
$I->amOnAction('ProjectController@getNotes', ['project' => $project]);
$I->submitForm('#new-note form', ['note_body' => 'note one']);
$I->amOnAction('ProjectController@getNotes', ['project' => $project]);
$I->see('note one', '//li[@id="note' . $project->notes()->first()->id . '"]');
}
示例8: loginSuccessfully
public function loginSuccessfully(\FunctionalTester $I)
{
$I->amOnRoute('site/login');
$I->submitForm('#login-form', ['LoginForm[username]' => 'admin', 'LoginForm[password]' => 'admin']);
$I->see('Главное меню');
$I->see('Система "Фрегат"');
$I->see('Регистр глаукомных пациентов');
$I->see('Настройки портала');
$I->see('Сменить пароль');
$I->dontSeeElement('form#login-form');
$I->canSeeCookie('_identity');
$I->canSeeCookie('PHPSESSID');
$this->cookie_identity = $I->grabCookie('_identity');
$this->cookie_session = $I->grabCookie('PHPSESSID');
}
示例9: updateTag
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function updateTag(FunctionalTester $I)
{
$I->am('Admin User');
$I->wantTo('edit an existing tag');
$tag = (new Tag())->where('group', '=', false)->get()->random(1);
$data = ['name' => 'tag updated'];
$tagName = $tag->name;
$I->amLoggedAs($I->createUser(1, 4));
$I->amOnAction('Administration\\TagsController@getIndex');
$I->click($this->_editTagSelector($tagName));
$I->seeCurrentActionIs('Administration\\TagsController@getEdit', ['tag' => $tag]);
$I->submitForm('form', $data);
$I->amOnAction('Administration\\TagsController@getIndex');
$I->see($data['name'], $this->_editTagSelector($data['name']));
$I->dontSee($data['name'], $this->_editTagSelector($tagName));
}
示例10: FunctionalTester
<?php
use Laracasts\TestDummy\Factory;
$I = new FunctionalTester($scenario);
$I->am('talent4startups member');
$I->wantTo('login to my talent4startups account');
$user = Factory::create('App\\Models\\User', ['password' => 'password']);
$I->amOnPage('/');
$I->click('#login-link');
$I->canSeeCurrentUrlEquals('/auth/login');
$I->submitForm('form', ['email' => $user->email, 'password' => '']);
$I->dontSeeAuthentication();
$I->submitForm('form', ['email' => $user->email, 'password' => 'wrong_password']);
$I->dontSeeAuthentication();
$I->submitForm('form', ['email' => $user->email, 'password' => 'password']);
$I->amLoggedAs($user);
示例11: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->am('a Administrator user');
$I->dontSeeAuthentication();
$I->amLoggedAs(['email' => 'admin@admin.com', 'password' => 'admin']);
$I->seeAuthentication();
//When
$I->amOnPage('/settings/users');
//And
$I->click('Create');
//Then
$I->seeCurrentUrlEquals('/settings/users/create');
//when
$form = ['name' => 'Mario', 'email' => 'mario@test.com'];
//And
$I->submitForm('//form', $form, 'Save');
//Then
$I->seeFormErrorMessage('password', 'The Password field is required.');
//When
$form = ['name' => 'Mario', 'email' => 'mario@test.com', 'password' => '123456', 'password_confirmation' => '123456'];
//and
$I->submitForm('//form', $form, 'Save');
//then
$I->seeCurrentUrlEquals('/settings/users');
$I->see('Mario');
$I->seeRecord('users', ['name' => 'Mario', 'email' => 'mario@test.com']);
示例12: deactivate_slide
public function deactivate_slide(FunctionalTester $I)
{
$I->am('Admin');
$I->wantTo('deactivate a slide');
$I->expectTo('see that the user has been deactivated');
/***************************************************************************************************************
* settings
**************************************************************************************************************/
// we create the admin role
$admin_role = $this->_createAdminRole();
// we attach it to the logged user
$admin_role->users()->attach($this->_user);
// we create a slide
$this->_createSlide();
/***************************************************************************************************************
* run test
**************************************************************************************************************/
$I->amOnPage('/');
$I->amOnRoute('home.edit');
$I->uncheckOption('#activate_' . $this->_slide->id);
$I->submitForm('#form_activate_' . $this->_slide->id, []);
$I->seeResponseCodeIs(200);
// $I->see(strip_tags(trans('home.message.slide.activation.success.label', ['action' => trans_choice('users.message.activation.success.action', false), 'slide' => $this->_slide->title])));
$I->seeRecord('slides', ['id' => $this->_slide->id, 'active' => false]);
}
示例13: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('Add a product to cart that has low stock');
$product = $I->createModel(DanPowell\Shop\Models\Product::class, [], 'inStock', 1);
$I->amOnRoute('shop.product.show', $product->slug);
$I->submitForm('#addToCart', ['quantity' => 15]);
$I->dontSee('Product added to cart');
$I->see('not enough product stock');
$I->seeFormHasErrors();
示例14: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->am('Registered LAZ User');
$I->wantTo('Post a new News Post on my timeline');
$I->amLoggedAs(['email' => 'email@email.com', 'password' => 'password']);
$I->seeAuthentication();
$I->amOnPage('/home');
$I->submitForm('#prevent', ['UserPosting' => 'JonDoe', 'UserPostingID' => '100', 'BaseComment' => 'We love big baconator from wendys'], 'Post');
$I->see('Posted Successfully');
示例15: signup
/**
* Sign up for a new user account with the given details.
* @param \AcceptanceTester|\FunctionalTester $I
* @param string $fields
*/
public static function signup($I, $fields)
{
$I->submitForm('#signup-form', ['SignupForm[email]' => $fields['email'], 'SignupForm[password]' => $fields['password'], 'SignupForm[forename]' => $fields['forename'], 'SignupForm[surname]' => $fields['surname']]);
}