本文整理汇总了PHP中FunctionalTester类的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester类的具体用法?PHP FunctionalTester怎么用?PHP FunctionalTester使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FunctionalTester类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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' => '[email protected]', 'password' => 'tester_password', 'password2' => 'tester_password']);
$registrationPage = RegistrationPage::openBy($I);
$I->amGoingTo('submit registration form with same data');
$registrationPage->submit(['username' => 'tester', 'email' => '[email protected]', '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 "[email protected]" 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]' => '[email protected]', '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('[email protected]', '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('[email protected]', '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
示例16: canEditMicroblog
public function canEditMicroblog(FunctionalTester $I)
{
$fake = Factory::create();
$text = $fake->text();
$id = $I->haveRecord('microblogs', ['user_id' => $this->user->id, 'text' => $text, 'created_at' => new DateTime(), 'updated_at' => new DateTime(), 'score' => 0]);
$I->amOnRoute('microblog.save', [$id]);
$I->see($text);
}
开发者ID:furious-programming,项目名称:coyote,代码行数:8,代码来源:MicroblogsCest.php
示例17: editAnAuthorWithInvalidAttributes
public function editAnAuthorWithInvalidAttributes(FunctionalTester $I)
{
$author = $I->haveAuthor();
$attributes = ['id' => $author->id, 'name' => 'Updated Author2', 'email' => 'debug'];
$I->sendPUT('/authors/' . $author->id, $attributes);
$I->sendGET('/authors');
$I->dontSeeResponseContainsJson($attributes);
}
开发者ID:jp7internet,项目名称:laravel-apz,代码行数:8,代码来源:AuthorControllerCest.php
示例18: it_should_render_extended_shortcode
/**
* @test
* it should render extended shortcode
*/
public function it_should_render_extended_shortcode(\FunctionalTester $I)
{
$content = 'Lorem ipsum [idlikethis]Some idea of mine[/idlikethis]';
$post_id = $I->havePostInDatabase(['post_name' => 'foo', 'post_content' => $content]);
$I->amOnPage('/foo');
$text = "Some idea of mine";
$I->seeElement('.idlikethis-button[data-post-id="' . $post_id . '"][data-text="' . $text . '"] button');
}
开发者ID:lucatume,项目名称:idlikethis,代码行数:12,代码来源:ShortcodeCest.php
示例19: checkIfLogin
/**
* Define custom actions here
*/
function checkIfLogin(\FunctionalTester $I)
{
//if ($I->loadSessionSnapshot('login')) return;
$I->amOnPage('/login');
$I->fillField(['name' => 'email'], Fixtures::get('username'));
$I->fillField(['name' => 'password'], Fixtures::get('password'));
$I->click('#loginButton');
//$I->saveSessionSnapshot('login');
}
开发者ID:magicians,项目名称:invoiceninja,代码行数:12,代码来源:FunctionalTester.php
示例20: 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
注:本文中的FunctionalTester类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论