本文整理汇总了PHP中app\helpers\Helper::generateRandomString方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::generateRandomString方法的具体用法?PHP Helper::generateRandomString怎么用?PHP Helper::generateRandomString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\helpers\Helper
的用法示例。
在下文中一共展示了Helper::generateRandomString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$I->lookForwardTo('seeing errors display');
$I->click(['link' => 'Create New']);
$I->amOnPage('admin/users/create');
$I->dontSee('Create User', '.page-header');
$I->see('Create User', 'h1.pull-left');
/* Submit form and expect errors */
$I->click(['name' => 'email']);
$I->submitForm('#userForm', ['email' => 'me@example.com']);
$I->seeElement('.alert-danger');
$I->dontSeeInSource('<br><');
/* Submit form and expect errors */
$I->click(['name' => 'email']);
$I->click(['name' => 'username']);
$I->submitForm('#userForm', ['email' => \App\Helpers\Helper::generateRandomString(15) . '@example.com', 'first_name' => 'Joe', 'last_name' => 'Smith', 'username' => \App\Helpers\Helper::generateRandomString(15)]);
$I->seeElement('.alert-danger');
$I->dontSeeInSource('<br><');
/* Submit form and expect success */
$I->wantTo('submit the form successfully');
$I->click(['name' => 'email']);
$I->fillField(['name' => 'email'], \App\Helpers\Helper::generateRandomString(15) . '@example.com');
$I->fillField(['name' => 'first_name'], 'Joe');
$I->fillField(['name' => 'last_name'], 'Smith');
$I->click(['name' => 'username']);
$I->fillField(['name' => 'username'], \App\Helpers\Helper::generateRandomString(15));
$I->click(['name' => 'password']);
$I->fillField(['name' => 'password'], 'password');
$I->click(['name' => 'password_confirm']);
$I->fillField(['name' => 'password_confirm'], 'password');
$I->click('Save');
$I->seeElement('.alert-success');
$I->dontSeeInSource('<br><');
示例2: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
AcceptanceTester::test_login($I);
$I->am('logged in user');
$I->wantTo('ensure that the categories listing page loads without errors');
$I->lookForwardTo('seeing it load without errors');
$I->amOnPage('/admin/settings/categories');
$I->waitForElement('.table', 10);
// secs
$I->seeNumberOfElements('tr', [1, 100]);
$I->seeInTitle('Categories');
$I->see('Categories');
$I->seeInPageSource('admin/settings/categories/create');
$I->dontSee('Categories', '.page-header');
$I->see('Categories', 'h1.pull-left');
/* Create Form */
$I->wantTo('ensure that the create category form loads without errors');
$I->lookForwardTo('seeing it load without errors');
$I->click(['link' => 'Create New']);
$I->amOnPage('/admin/settings/categories/create');
$I->dontSee('Create Category', '.page-header');
$I->see('Create Category', 'h1.pull-left');
$I->dontSee('<span class="');
$I->fillField('name', \App\Helpers\Helper::generateRandomString(15));
$I->selectOption('form select[name=category_type]', 'Asset');
$I->click('Save');
$I->dontSee('<span class="');
$I->dontSeeElement('.alert-danger');