本文整理汇总了PHP中Faker\Generator::unique方法的典型用法代码示例。如果您正苦于以下问题:PHP Generator::unique方法的具体用法?PHP Generator::unique怎么用?PHP Generator::unique使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Faker\Generator
的用法示例。
在下文中一共展示了Generator::unique方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: storeSomethingInSession
/**
* @test
*
* @covers ::setUp
*/
public function storeSomethingInSession()
{
$trait = $this->getTraitMock();
$trait->startApplication();
$data = [$this->faker->unique()->word => $this->faker->address, $this->faker->unique()->word => $this->faker->address, $this->faker->unique()->word => $this->faker->address];
$trait->session($data);
$trait->assertSessionHasAll($data);
$trait->flushSession();
$trait->stopApplication();
}
示例2: distributeRubrics
private function distributeRubrics()
{
print_r("Distribute rubrics for company...");
$companies = Company::find()->all();
$rubrics = Rubric::findRecursive(array(), 'down', true);
$rubrics_ids = ArrayHelper::getColumn($rubrics, 'id');
$rubrics_ids_count = count($rubrics_ids);
foreach ($companies as $company) {
$this->faker->unique(true);
$rubric_for_company_count = $this->faker->numberBetween(self::MIN_RUBRIC_FOR_COMPANY, self::MAX_RUBRIC_FOR_COMPANY);
for ($i = 1; $i <= $rubric_for_company_count; $i++) {
$company_rubric = new CompanyRubric();
$company_rubric->company_id = $company->id;
$company_rubric->rubric_id = $rubrics_ids[$this->faker->unique()->numberBetween(0, $rubrics_ids_count - 1)];
$company_rubric->save();
}
}
print_r("DONE" . PHP_EOL);
}
示例3: getDummyData
public function getDummyData(Generator $faker, array $customValues = [])
{
return ['reference' => $faker->unique()->bothify('????###'), 'central' => $faker->randomNumber(4), 'cc_cd' => $faker->numerify('CC-###'), 'capacity_asap' => $faker->randomNumber(6), 'capacity_adp' => $faker->randomNumber(6)];
}
示例4: getDummyData
public function getDummyData(Generator $faker, array $customValues = [])
{
$firs_name = $faker->firstName;
$last_name = $faker->lastName;
return ['identification' => $faker->unique()->numberBetween(5000000, 39999999), 'first_name' => $firs_name, 'last_name' => $last_name, 'full_name' => $firs_name . ' ' . $last_name, 'avatar' => 'vendor/AdminTheme/images/avatar/default.png', 'type' => $faker->randomElement(['moderator', 'user']), 'email' => $faker->unique()->email, 'password' => '123456'];
}
示例5: getDummyData
public function getDummyData(Generator $faker, array $valoresPersonalizados = array())
{
return ['nombre' => $faker->firstName, 'apellido' => $faker->lastName, 'email' => $faker->unique()->email, 'telefono' => '5' . $faker->randomNumber($nbDigits = 6), 'celular' => '9' . $faker->randomNumber($nbDigits = 8), 'activo' => 1];
}
示例6: getDummyData
public function getDummyData(Generator $faker, array $customValues = array())
{
return ['name' => $faker->name, 'email' => $faker->unique()->email, 'password' => bcrypt('secret')];
}
示例7: getDummyData
public function getDummyData(Generator $faker, array $customValues = [])
{
$firs_name = $faker->firstName;
$last_name = $faker->lastName;
return ['first_name' => $firs_name, 'last_name' => $last_name, 'full_name' => $firs_name . ' ' . $last_name, 'type' => 'user', 'email' => $faker->unique()->email, 'password' => \Hash::make('123456')];
}
示例8: canTestAllOfTraitsMethods
/**
* @test
*/
public function canTestAllOfTraitsMethods()
{
$this->assertGetterSetterTraitMethods(DummyTrait::class, $this->faker->unique()->name, $this->faker->unique()->name);
}
示例9: getDummyData
public function getDummyData(Generator $faker, array $custom = [])
{
return ['biography' => $faker->paragraph(4), 'twitter' => '@' . $faker->userName, 'path_avatar' => $faker->imageUrl(250, 300, 'people'), 'web' => $faker->domainName, 'user_id' => $faker->unique()->numberBetween(1, 300)];
}
示例10: getDummyData
public function getDummyData(Generator $faker, array $valoresPersonalizados = array())
{
return ['email' => $faker->unique()->email, 'password' => bcrypt('secret'), 'dni' => $faker->unique()->randomNumber($nbDigits = 8), 'rol_id' => 2];
}
示例11: getDummyData
public function getDummyData(Generator $faker, array $customValue = array())
{
return ['name' => $faker->name, 'email' => $faker->unique()->email, 'password' => bcrypt('123123'), 'type' => 'User'];
}
示例12: getDummyData
public function getDummyData(Generator $faker, array $customValues = [])
{
return ['reference' => $faker->unique()->bothify('????###'), 'description' => $faker->paragraph(1), 'strip_type_id' => rand(1, 5)];
}
示例13: getDummyData
public function getDummyData(Generator $faker, array $customValues = [])
{
return ['reference' => $faker->unique()->bothify('????###'), 'description' => $faker->paragraph(1), 'street' => $faker->streetName, 'croos' => $faker->streetName, 'latitude' => $faker->latitude(), 'longitude' => $faker->longitude(), 'capacity' => rand(1, 600)];
}