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


PHP FunctionalTester類代碼示例

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


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

示例1: should_correctly_route_to_index

 /** @test */
 public function should_correctly_route_to_index(FunctionalTester $I)
 {
     // given .. I am on index page
     $I->amOnPage('/');
     // then ... I should see correct route
     $I->seeCurrentUrlEquals('/');
 }
開發者ID:neilrussell6,項目名稱:l5-task-list,代碼行數:8,代碼來源:IndexCest.php

示例2: testChangePassword

 public function testChangePassword(FunctionalTester $I)
 {
     $I->amGoingTo('test the change password functionality');
     // Create one user
     $user = Commons::createUser();
     $I->amGoingTo('login a user');
     $loginPage = LoginPage::openBy($I);
     $loginPage->login(Commons::TEST_EMAIL, Commons::TEST_PASSWORD);
     $changePasswordPage = ChangePasswordPage::openBy($I);
     $I->see('Change password');
     $I->seeElement('#changepasswordform-newpassword');
     $I->seeElement('#changepasswordform-newpasswordrepeat');
     $I->dontSeeElement('#changepasswordform-email');
     $I->dontSeeElement('#changepasswordform-oldpassword');
     $I->amGoingTo('try to change the password with two different passwords for the new password and the new password repeat fields');
     $changePasswordPage->changePassword('123123', '234234');
     $I->expect('the form will catch the difference');
     $I->see('The new passwords are not the same.');
     $I->amGoingTo('test adding new password with length lower than the default length');
     $changePasswordPage->changePassword('123', '123');
     $I->expect('the form will warn the user');
     $I->see('New password should contain at least 6 characters');
     $I->see('New password repeat should contain at least 6 characters');
     $I->amGoingTo('change the password of the user properly');
     $changePasswordPage->changePassword('Nik)lay!23', 'Nik)lay!23');
     $I->expect('that this time everything will be ok and the user will be redirected to the home page');
     $user->refresh();
     $I->assertNotNull($user->password_changed_at);
     $I->seeInCurrentUrl('/');
 }
開發者ID:nkostadinov,項目名稱:yii2-user,代碼行數:30,代碼來源:ChangePasswordCest.php

示例3: seeContact

 /**
  * @param FunctionalTester $I
  */
 public function seeContact(FunctionalTester $I)
 {
     $I->wantToTest('if I can see the contact form as anonymous user');
     $I->amOnPage('/');
     $I->click(['link' => 'Contact']);
     $I->see('ContactForm');
 }
開發者ID:smartinmedia,項目名稱:cunity-test,代碼行數:10,代碼來源:SmokeAnonymCest.php

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: it_should_allow_not_having_a_link_in_the_database

 /**
  * @test
  * it should allow not having a link in the database
  */
 public function it_should_allow_not_having_a_link_in_the_database(FunctionalTester $I)
 {
     $id = $I->haveLinkInDatabase();
     $I->seeLinkInDatabase(['link_id' => $id]);
     $I->dontHaveLinkInDatabase(['link_id' => $id]);
     $I->dontSeeLinkInDatabase(['link_id' => $id]);
 }
開發者ID:lucatume,項目名稱:wp-browser,代碼行數:11,代碼來源:WPDbLinksCest.php

示例10: 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

示例11: getNoErrorWithTwigUnknownsIfIgnoring

 public function getNoErrorWithTwigUnknownsIfIgnoring(FunctionalTester $I)
 {
     $I->bootKernelWith('unknowns_suppress');
     $I->runCommand('maba_webpack.command.setup');
     $I->runCommand('maba_webpack.command.compile');
     $I->seeCommandStatusCode(0);
 }
開發者ID:mariusbalcytis,項目名稱:webpack-bundle,代碼行數:7,代碼來源:CompileCest.php

示例12: deleteMyRedirect

 public function deleteMyRedirect(FunctionalTester $I)
 {
     $I->haveRecord('links', $this->linkRecord);
     LinksPage::of($I)->deleteLink();
     $I->dontSeeRecord('links', $this->linkRecord);
     $I->seeCurrentUrlEquals(LinksPage::$URL);
     $I->dontSee('/' . $this->link['uri']);
 }
開發者ID:mlanin,項目名稱:go,代碼行數:8,代碼來源:LinksCest.php

示例13: 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

示例14: 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

示例15: dontSeeVisualChanges

 /**
  * @param FunctionalTester $I
  */
 public function dontSeeVisualChanges(FunctionalTester $I)
 {
     $I->amOnPage('/');
     $I->dontSeeVisualChanges('same');
     // the test has to be called twice for comparison on the travis server
     $I->amOnPage('/');
     $I->dontSeeVisualChanges('same');
 }
開發者ID:nubium,項目名稱:puffin,代碼行數:11,代碼來源:VisualChangesCest.php


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