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


PHP FunctionalTester::wantTo方法代碼示例

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


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

示例1: checkAuthEndpoint

 public function checkAuthEndpoint(FunctionalTester $I)
 {
     $I->wantTo('Visit login endpoint');
     $I->amOnPage('login');
     $I->seeResponseCodeIs(200);
     $I->wantTo('Visit register endpoint');
     $I->amOnPage('register');
     $I->seeResponseCodeIs(200);
 }
開發者ID:inoplate,項目名稱:account,代碼行數:9,代碼來源:AuthCest.php

示例2: testValidDetails

 public function testValidDetails(\FunctionalTester $I)
 {
     $I->wantTo('test logging in with the correct details');
     LoginPage::openBy($I);
     LoginPage::loginAsUser($I);
     $I->seeCurrentUrlEquals(IndexPage::$url);
 }
開發者ID:rhamlet1,項目名稱:Hazid,代碼行數:7,代碼來源:LoginCest.php

示例3: testUserRegistration

 /**
  *
  * @param \FunctionalTester $I
  * @param \Codeception\Scenario $scenario
  */
 public function testUserRegistration($I, $scenario)
 {
     $I->wantTo('ensure that registration works');
     $registrationPage = RegistrationPage::openBy($I);
     $I->see('Sign up', 'h1');
     $I->amGoingTo('submit registration form with no data');
     $registrationPage->submit([]);
     $I->expectTo('see validations errors');
     $I->see('Username cannot be blank.', '.help-block');
     $I->see('E-mail cannot be blank.', '.help-block');
     $I->see('Password cannot be blank.', '.help-block');
     $I->see('Repeated password cannot be blank.', '.help-block');
     $I->amGoingTo('submit registration form with not correct email and repeated password');
     $registrationPage->submit(['username' => 'tester', 'email' => 'tester.email', 'password' => 'tester_password', 'password2' => 'tester_password2']);
     $I->expectTo('see that email address and repeated password is wrong');
     $I->dontSee('Username cannot be blank.', '.help-block');
     $I->dontSee('Password cannot be blank.', '.help-block');
     $I->dontSee('Repeated password cannot be blank.', '.help-block');
     $I->see('E-mail is not a valid email address.', '.help-block');
     $I->see('Repeated password must be repeated exactly.', '.help-block');
     $I->amGoingTo('submit registration form with correct data');
     $registrationPage->submit(['username' => 'tester', 'email' => 'tester.email@example.com', 'password' => 'tester_password', 'password2' => 'tester_password']);
     $registrationPage = RegistrationPage::openBy($I);
     $I->amGoingTo('submit registration form with same data');
     $registrationPage->submit(['username' => 'tester', 'email' => 'tester.email@example.com', 'password' => 'tester_password', 'password2' => 'tester_password']);
     $I->expectTo('see that username and email address have already been taken');
     $I->see('Username "tester" has already been taken.', '.help-block');
     $I->see('E-mail "tester.email@example.com" has already been taken.', '.help-block');
     //        $I->expectTo('see that user logged in');
     //        $I->seeLink('Logout (tester)');
 }
開發者ID:manyoubaby123,項目名稱:imshop,代碼行數:36,代碼來源:RegisrationCest.php

示例4: testPageContent

 public function testPageContent(\FunctionalTester $I)
 {
     $I->wantTo('test that the project creation page works');
     CreatePage::openBy($I, $this->params);
     $I->see(CreatePage::$headingText, CreatePage::$headingSelector);
     $I->see(CreatePage::$placeholderText);
 }
開發者ID:rhamlet1,項目名稱:Hazid,代碼行數:7,代碼來源:CreateCest.php

示例5: guestCantVisitRolesPage

 public function guestCantVisitRolesPage(FunctionalTester $I)
 {
     $I->am('a guest');
     $I->wantTo('make sure I can\'t view the roles page');
     //I can see the menu item
     $I->amOnPage('/roles');
     $I->canSeeCurrentUrlEquals('/login');
 }
開發者ID:adamstrawson,項目名稱:BBMembershipSystem,代碼行數:8,代碼來源:RolesCest.php

示例6: testUnApprovedUser

 public function testUnApprovedUser(FunctionalTester $I)
 {
     $I->wantTo('ensure that unapproved user cannot login');
     $loginPage = LoginPage::openBy($I);
     $loginPage->login('UnApprovedUser', '123qwe');
     $I->expectTo('see validations errors');
     $I->see('Your account is not approved yet!');
 }
開發者ID:VasileGabriel,項目名稱:humhub,代碼行數:8,代碼來源:LoginCest.php

示例7: it_should_insert_a_user_in_the_database_allowing_for_user_defaults_override

 /**
  * @test
  * it should insert a user in the database allowing for user defaults override
  */
 public function it_should_insert_a_user_in_the_database_allowing_for_user_defaults_override(FunctionalTester $I)
 {
     $I->wantTo('insert a user in the database overriding defaults');
     $table = $I->grabPrefixedTableNameFor('users');
     $overrides = ['user_pass' => 'luca12345678', 'user_nicename' => 'lucatume', 'user_email' => 'luca@theaveragedev.com', 'user_url' => 'http://theaveragedev.com', 'user_status' => 1, 'user_activation_key' => 'foo', 'display_name' => 'theAverageDev'];
     $I->haveUserInDatabase('Luca', 'subscriber', $overrides);
     $I->seeUserInDatabase($overrides);
 }
開發者ID:lucatume,項目名稱:wp-browser,代碼行數:12,代碼來源:WPDbUserCest.php

示例8: testValidPassword

 public function testValidPassword(\FunctionalTester $I)
 {
     $I->wantTo('test that supplying valid new password succeeds');
     ResetPasswordPage::setNewPassword($I, Auth::$newPassword);
     $I->seeCurrentUrlEquals(IndexPage::$url);
     $I->see('Your new password has been saved.');
     $hash = $I->grabRecord('app\\models\\User', ['email' => Auth::$validEmail])->passwordHash;
     $I->assertTrue(Yii::$app->getSecurity()->validatePassword(Auth::$newPassword, $hash));
 }
開發者ID:rhamlet1,項目名稱:Hazid,代碼行數:9,代碼來源:ResetPasswordCest.php

示例9: updateItem

 public function updateItem(FunctionalTester $I, $scenario)
 {
     $I->wantTo('modify an existing item');
     $I->sendPUT('/vehicles/123', ['name' => 'Pansy updated']);
     $scenario->incomplete('work in progress');
     $I->seeResponseCodeIs(200);
     $I->seeResponseIsJson();
     $I->seeResponseContainsJson(['id' => 123, 'name' => 'Pansy updated']);
 }
開發者ID:tekkie,項目名稱:autolog-api,代碼行數:9,代碼來源:VehiclesCest.php

示例10: GetTimestamp

 public function GetTimestamp(Tester $I)
 {
     $I->wantTo('Get Current Server Timestamp, make sure it is smaller than local');
     $I->haveHttpHeader("apikey", $this->apiInfo[Helper::CSV_ORDER_APIKEY]);
     $I->sendGET("currenttime", ["source" => $this->apiInfo[Helper::CSV_ORDER_SOURCE]]);
     $response = $I->grabResponse();
     $timeDifference = time() - intval($response);
     $I->assertTrue($timeDifference < 90 && $timeDifference > -90);
 }
開發者ID:parisqian-misa,項目名稱:NTUC-API,代碼行數:9,代碼來源:CurrenttimeCest.php

示例11: testRegisterSuccsess

 public function testRegisterSuccsess(FunctionalTester $I)
 {
     $I->wantTo('register a user');
     $I->amOnPage('/register');
     $I->fillField('name', 'JohnDoe');
     $I->fillField('email', 'johnDoe@gmail.com');
     $I->fillField('password', 'admin');
     $I->fillField('password_confirmation', 'admin');
     $I->click('Continue');
     $I->amOnPage('/');
 }
開發者ID:nguyentantintb,項目名稱:wedding-card,代碼行數:11,代碼來源:WeddingCardTestCest.php

示例12: invalidUsernamePassword

 /**
  * @param FunctionalTester $I
  *
  * @return void
  */
 public function invalidUsernamePassword(FunctionalTester $I)
 {
     $I->wantTo('login with invalid username/password');
     $I->amOnAction('HomeController@getIndex');
     $I->dontSeeAuthentication();
     $I->see('Login');
     $I->fillField('Email', 'user@user.com');
     $I->fillField('Password', '1234');
     $I->click('Login');
     $I->dontSeeAuthentication();
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:16,代碼來源:LoginCest.php

示例13: trySigninWithInvalidCredentials

 public function trySigninWithInvalidCredentials(FunctionalTester $I)
 {
     $I->wantTo('Login as user with invalid credentials');
     $I->dontSeeAuthentication();
     $I->amOnPage('/login');
     $I->fillField('identifier', 'spectator');
     $I->fillField('password', 'invalid');
     $I->click('button[type=submit]');
     $I->seeCurrentUrlEquals('/login');
     $I->dontSeeAuthentication();
 }
開發者ID:inoplate,項目名稱:account,代碼行數:11,代碼來源:LoginCest.php

示例14: testVolunteerFormLinkWithLogin

 public function testVolunteerFormLinkWithLogin(\FunctionalTester $I)
 {
     $I->wantTo('check that logging in after trying to access the volunteer form redirects me to the volunteer form');
     IndexPage::openBy($I);
     $I->click(IndexPage::$volunteerFormButtonText, IndexPage::$contentSelector);
     $I->seeCurrentUrlEquals(LoginPage::$url);
     LoginPage::loginAsUser($I);
     $I->seeCurrentUrlEquals(VolunteerPage::$url);
     $I->seeLink(VolunteerPage::$logoutLinkText);
     $I->see(VolunteerPage::$headingText, VolunteerPage::$headingSelector);
 }
開發者ID:rhamlet1,項目名稱:Hazid,代碼行數:11,代碼來源:IndexCest.php

示例15: testValidDetails

 public function testValidDetails(\FunctionalTester $I)
 {
     $page = $this->page;
     $activity = $this->activity;
     $I->wantTo('test that submitting valid data is successful');
     $page::openBy($I, $this->params);
     $page::submit($I, ['project' => $activity::$project, 'name' => $activity::$name, 'date' => $activity::$date, 'description' => $activity::$description]);
     $I->seeCurrentUrlEquals(IndexPage::$url);
     $I->see($activity::$name);
     $I->seeRecord('app\\models\\ProjectActivity', ['projectID' => $activity::$project, 'name' => $activity::$name, 'date' => $activity::$date, 'description' => $activity::$description]);
 }
開發者ID:rhamlet1,項目名稱:Hazid,代碼行數:11,代碼來源:FormTests.php


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