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


PHP FunctionalTester::submitForm方法代碼示例

本文整理匯總了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.');
 }
開發者ID:yii2mod,項目名稱:base,代碼行數:7,代碼來源:ChangePasswordViaAccountPageCest.php

示例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']);
 }
開發者ID:yii2mod,項目名稱:base,代碼行數:9,代碼來源:CreateUserCest.php

示例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.');
 }
開發者ID:chizdrel,項目名稱:yii2-app-basic,代碼行數:7,代碼來源:ContactFormCest.php

示例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');
 }
開發者ID:yii2mod,項目名稱:base,代碼行數:7,代碼來源:LoginCest.php

示例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.');
 }
開發者ID:v-radev,項目名稱:laravel-auth-pack,代碼行數:10,代碼來源:RegisterFunctionalCest.php

示例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');
 }
開發者ID:yii2mod,項目名稱:base,代碼行數:12,代碼來源:AdminLoginCest.php

示例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 . '"]');
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:19,代碼來源:CrudProjectNotesCest.php

示例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');
 }
開發者ID:vovancho,項目名稱:yii2test,代碼行數:15,代碼來源:LoginCest.php

示例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));
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:23,代碼來源:CrudTagCest.php

示例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);
開發者ID:katzumi,項目名稱:talent4startups,代碼行數:16,代碼來源:SigninCept.php

示例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']);
開發者ID:raulbravo23,項目名稱:salepoint,代碼行數:27,代碼來源:CreateUserCept.php

示例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]);
 }
開發者ID:Okipa,項目名稱:una.app,代碼行數:25,代碼來源:HomeCest.php

示例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();
開發者ID:dan-powell,項目名稱:shop,代碼行數:10,代碼來源:AddCartLowStockCept.php

示例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');
開發者ID:Core-Tech-Labs,項目名稱:LAZ,代碼行數:10,代碼來源:PostNewsFeedCept.php

示例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']]);
 }
開發者ID:rhamlet1,項目名稱:Hazid,代碼行數:9,代碼來源:SignupPage.php


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