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


PHP Helper::generateRandomString方法代碼示例

本文整理匯總了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><');
開發者ID:stijni,項目名稱:snipe-it,代碼行數:31,代碼來源:UsersCept.php

示例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('&lt;span class=&quot;');
$I->fillField('name', \App\Helpers\Helper::generateRandomString(15));
$I->selectOption('form select[name=category_type]', 'Asset');
$I->click('Save');
$I->dontSee('&lt;span class=&quot;');
$I->dontSeeElement('.alert-danger');
開發者ID:stijni,項目名稱:snipe-it,代碼行數:29,代碼來源:CategoriesCept.php


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