本文整理匯總了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');