當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。