当前位置: 首页>>代码示例>>PHP>>正文


PHP Generator::unique方法代码示例

本文整理汇总了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();
 }
开发者ID:aedart,项目名称:testing-laravel,代码行数:15,代码来源:TestHelperTraitTest.php

示例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);
 }
开发者ID:novikovsergey,项目名称:doublegis,代码行数:19,代码来源:GeneratorController.php

示例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)];
 }
开发者ID:jrafaelca,项目名称:tracking_cabinets,代码行数:4,代码来源:WiresTableSeeder.php

示例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'];
 }
开发者ID:jrafaelca,项目名称:user-management,代码行数:6,代码来源:UserTableSeeder.php

示例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];
 }
开发者ID:dsalazar37,项目名称:electivos,代码行数:4,代码来源:TutorTableSeeder.php

示例6: getDummyData

 public function getDummyData(Generator $faker, array $customValues = array())
 {
     return ['name' => $faker->name, 'email' => $faker->unique()->email, 'password' => bcrypt('secret')];
 }
开发者ID:ariels78,项目名称:TeachMe,代码行数:4,代码来源:UserTableSeeder.php

示例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')];
 }
开发者ID:jrafaelca,项目名称:tracking_cabinets,代码行数:6,代码来源:AdminTableSeeder.php

示例8: canTestAllOfTraitsMethods

 /**
  * @test
  */
 public function canTestAllOfTraitsMethods()
 {
     $this->assertGetterSetterTraitMethods(DummyTrait::class, $this->faker->unique()->name, $this->faker->unique()->name);
 }
开发者ID:aedart,项目名称:testing-gst,代码行数:7,代码来源:GetterSetterTraitTesterTest.php

示例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)];
 }
开发者ID:tavo1987,项目名称:linkbox,代码行数:4,代码来源:UserProfileTableSeeder.php

示例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];
 }
开发者ID:dsalazar37,项目名称:electivos,代码行数:4,代码来源:UsuarioTableSeeder.php

示例11: getDummyData

 public function getDummyData(Generator $faker, array $customValue = array())
 {
     return ['name' => $faker->name, 'email' => $faker->unique()->email, 'password' => bcrypt('123123'), 'type' => 'User'];
 }
开发者ID:juansleonc,项目名称:lab-laravel,代码行数:4,代码来源:UsersTableSeeder.php

示例12: getDummyData

 public function getDummyData(Generator $faker, array $customValues = [])
 {
     return ['reference' => $faker->unique()->bothify('????###'), 'description' => $faker->paragraph(1), 'strip_type_id' => rand(1, 5)];
 }
开发者ID:jrafaelca,项目名称:tracking_cabinets,代码行数:4,代码来源:StripsTableSeeder.php

示例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)];
 }
开发者ID:jrafaelca,项目名称:tracking_cabinets,代码行数:4,代码来源:CabinetTableSeeder.php


注:本文中的Faker\Generator::unique方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。