当前位置: 首页>>代码示例>>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;未经允许,请勿转载。