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


PHP Generator::text方法代码示例

本文整理汇总了PHP中Faker\Generator::text方法的典型用法代码示例。如果您正苦于以下问题:PHP Generator::text方法的具体用法?PHP Generator::text怎么用?PHP Generator::text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Faker\Generator的用法示例。


在下文中一共展示了Generator::text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 public function setUp()
 {
     $this->faker = Factory::create();
     $this->id = TwitterMessageId::create($this->faker->uuid);
     $this->lang = $this->faker->countryISOAlpha3;
     $this->userName = $this->faker->userName;
     $this->hashtagText = $this->faker->word;
     $this->text = $this->faker->text();
     $this->complexText = '@' . $this->userName . ' ' . $this->text . ' #' . $this->hashtagText;
     $this->date = new \DateTimeImmutable();
     $this->coordinates = \Mockery::mock(TwitterCoordinates::class);
     $this->place = \Mockery::mock(TwitterPlace::class);
     $this->inReplyToStatusId = $this->faker->randomNumber();
     $this->inReplyToUserId = $this->faker->randomNumber();
     $this->inReplyToScreenName = $this->faker->userName;
     $this->retweeted = $this->faker->boolean();
     $this->retweetCount = $this->faker->randomNumber();
     $this->favorited = $this->faker->boolean();
     $this->favoriteCount = $this->faker->randomNumber();
     $this->truncated = $this->faker->boolean();
     $this->source = null;
     $this->retweetedStatus = \Mockery::mock(Tweet::class);
     $this->hashtag = \Mockery::mock(TwitterHashtag::class);
     $this->userMention = \Mockery::mock(TwitterUserMention::class);
     $this->sender = \Mockery::mock(TwitterUser::class);
     $this->recipient = \Mockery::mock(TwitterUser::class);
     $this->entities = \Mockery::mock(TwitterEntities::class);
 }
开发者ID:remi-san,项目名称:twitter,代码行数:28,代码来源:TweetTest.php

示例2: editTask

 public function editTask(AcceptanceTester $I)
 {
     $description = $this->faker->text(100);
     $I->wantTo('edit a task');
     $I->amOnPage('/tasks/1/edit');
     $I->seeCurrentUrlEquals('/tasks/1/edit');
     $I->fillField('#description', $description);
     $I->click('Save');
     $I->seeInDatabase('tasks', ['description' => $description]);
 }
开发者ID:hannenijhuis,项目名称:invoiceninja,代码行数:10,代码来源:TaskCest.php

示例3: getDefaultFields

 /**
  * Returns default values by given fields
  *
  * @param array $fields
  * @return array
  */
 protected function getDefaultFields(array $fields)
 {
     $defaults = array('oxid' => $this->generator->md5, 'oxparentid' => '', 'oxactive' => '1', 'oxtimestamp' => $this->generator->dateTime, 'oxshopid' => 'oxbaseshop', 'oxsort' => $this->generator->randomNumber(), 'oxactivefrom' => '0000-00-00 00:00:00', 'oxactiveto' => '0000-00-00 00:00:00', 'oxdesc' => $this->generator->text(255), 'oxshortdesc' => $this->generator->text(50));
     foreach ($defaults as $key => $value) {
         if (false === in_array($key, $fields)) {
             unset($defaults[$key]);
         }
     }
     return $defaults;
 }
开发者ID:edvinaskrucas,项目名称:srunit,代码行数:16,代码来源:AbstractProvisioner.php

示例4: setUp

 public function setUp()
 {
     $this->faker = Factory::create();
     $this->id = TwitterMessageId::create($this->faker->uuid);
     $this->userName = $this->faker->userName;
     $this->hashtagText = $this->faker->word;
     $this->text = $this->faker->text();
     $this->complexText = '@' . $this->userName . ' ' . $this->text . ' #' . $this->hashtagText;
     $this->date = new \DateTimeImmutable();
     $this->hashtag = \Mockery::mock(TwitterHashtag::class);
     $this->userMention = \Mockery::mock(TwitterUserMention::class);
     $this->sender = \Mockery::mock(TwitterUser::class);
     $this->recipient = \Mockery::mock(TwitterUser::class);
     $this->entities = \Mockery::mock(TwitterEntities::class);
 }
开发者ID:remi-san,项目名称:twitter,代码行数:15,代码来源:DirectMessageTest.php

示例5: handleString

 /**
  * Generate a string
  *
  * @param $schema
  * @param $required
  * @param null $property
  * @return null|string
  * @throws InvalidArgumentException
  */
 private function handleString($schema, $required, $property = null)
 {
     if (!$this->shouldHandle($required)) {
         return null;
     }
     $enum = $this->getEnum($schema);
     if (null !== $enum) {
         return $enum;
     }
     if ($this->provider->hasProperty($schema, 'pattern')) {
         $pattern = $this->provider->getProperty($schema, 'pattern');
         return $this->generator->regexify($pattern);
     }
     if ($this->hasFormatter($schema, $property)) {
         $formatter = $this->getFormatter($schema, $property);
         return $formatter();
     }
     $maxLength = $this->provider->getProperty($schema, 'maxLength', $this->config->getMaxLength());
     $minLength = $this->provider->getProperty($schema, 'minLength', $this->config->getMinLength());
     $text = $this->generator->text($maxLength);
     while (strlen($text) < $minLength) {
         $text .= $this->generator->randomLetter;
     }
     return $text;
 }
开发者ID:tebru,项目名称:swagger-faker,代码行数:34,代码来源:SchemaGenerator.php

示例6: submitASession

 /**
  * @param \AcceptanceTester $I
  */
 public function submitASession(AcceptanceTester $I)
 {
     $I->am('an attendee');
     $I->wantTo('submit a session');
     $I->expect('to be able a submit a new session');
     // Login user.
     $I->amOnPage('/user/login');
     $I->submitForm('#user-login-form', ['name' => 'user1', 'pass' => '123456']);
     $I->seeElement('body.user-logged-in');
     // Fill session submission.
     $I->amOnPage('/node/add/session');
     $node_title = $this->faker->text(30);
     $I->fillField('title[0][value]', $node_title);
     $I->fillCkEditorByName('body[0][value]', $this->faker->text(100));
     $I->fillField('field_author[0][target_id]', 'user1 (2)');
     $I->selectOption('field_exp_level', 0);
     $I->selectOption('field_session_track', 'development');
     $I->makeScreenshot('session_form');
     $I->submitForm('#node-session-form', [], 'op');
     $I->makeScreenshot('session_view');
     $I->see($node_title, '.l-content');
 }
开发者ID:itamair,项目名称:ddd-website,代码行数:25,代码来源:SessionCest.php

示例7: resolveConfigType

 private function resolveConfigType($config)
 {
     switch ($config['type']) {
         case "url":
             return $this->faker->url;
         case "image":
             $width = isset($config['options']['width']) ? $config['options']['width'] : 800;
             $height = isset($config['options']['height']) ? $config['options']['height'] : 400;
             return $this->faker->imageUrl($width, $height);
         case "page_select":
             $page = ['title' => $this->faker->sentence(), 'body' => $this->faker->text(6000), 'slug' => $this->faker->slug, 'created' => $this->faker->date()];
             return $page;
         case "product_category_select":
         case "collection_select":
             $category = ["name" => $this->faker->word, "slug" => $this->faker->slug];
             return $category;
         case "product_select":
             return $this->tdk->makeProduct();
         default:
             return $this->faker->word;
     }
 }
开发者ID:pasls,项目名称:tdk,代码行数:22,代码来源:ConfigManager.php

示例8: fillItems

 private function fillItems(AcceptanceTester $I, $max = 2)
 {
     for ($i = 1; $i <= $max; $i++) {
         $row_selector = sprintf('table.invoice-table tbody tr:nth-child(%d) ', $i);
         $product_key = $this->faker->text(10);
         $description = $this->faker->text(80);
         $unit_cost = $this->faker->randomFloat(2, 0, 100);
         $quantity = $this->faker->randomDigitNotNull;
         $I->fillField($row_selector . '#product_key', $product_key);
         $I->fillField($row_selector . 'textarea', $description);
         $I->fillField($row_selector . 'td:nth-child(4) input', $unit_cost);
         $I->fillField($row_selector . 'td:nth-child(5) input', $quantity);
     }
 }
开发者ID:rafaelsisweb,项目名称:invoice-ninja,代码行数:14,代码来源:InvoiceCest.php

示例9: createQuote

 public function createQuote(AcceptanceTester $I)
 {
     $clientEmail = $this->faker->safeEmail;
     $productKey = $this->faker->text(10);
     $I->wantTo('create a quote');
     // create client
     $I->amOnPage('/clients/create');
     $I->fillField(['name' => 'contacts[0][email]'], $clientEmail);
     $I->click('Save');
     $I->see($clientEmail);
     // create product
     $I->amOnPage('/products/create');
     $I->fillField(['name' => 'product_key'], $productKey);
     $I->fillField(['name' => 'notes'], $this->faker->text(80));
     $I->fillField(['name' => 'cost'], $this->faker->numberBetween(1, 20));
     $I->click('Save');
     $I->wait(1);
     //$I->see($productKey);
     // create quote
     $I->amOnPage('/quotes/create');
     $I->selectDropdown($I, $clientEmail, '.client_select .dropdown-toggle');
     $I->fillField('table.invoice-table tbody tr:nth-child(1) #product_key', $productKey);
     $I->click('table.invoice-table tbody tr:nth-child(1) .tt-selectable');
     $I->click('Save');
     $I->see($clientEmail);
     // enter payment
     $clientId = $I->grabFromDatabase('contacts', 'client_id', ['email' => $clientEmail]);
     $invoiceId = $I->grabFromDatabase('invoices', 'id', ['client_id' => $clientId]);
     $invitationKey = $I->grabFromDatabase('invitations', 'invitation_key', ['invoice_id' => $invoiceId]);
     $clientSession = $I->haveFriend('client');
     $clientSession->does(function (AcceptanceTester $I) use($invitationKey) {
         $I->amOnPage('/view/' . $invitationKey);
         $I->click('Approve');
         $I->see('This quote is approved');
     });
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:36,代码来源:QuoteCest.php

示例10: setUp

 public function setUp()
 {
     $this->faker = Factory::create();
     $this->message = $this->faker->text();
 }
开发者ID:remi-san,项目名称:mini-game,代码行数:5,代码来源:ExceptionTest.php

示例11: getDummyData

 public function getDummyData(Generator $faker, array $customValues = array())
 {
     return ['comunidad' => $faker->company, 'tipo_secretariado_id' => rand(1, 3), 'responsable' => $faker->name($gender = null | 'male' | 'female'), 'direccion' => $faker->randomElement(['Numancia, 22', 'Escaleritas, 128', 'Carvajal, 32']), 'cp' => $faker->randomElement(['35012', '35016', '35018', '35010', '32012']), 'pais_id' => 73, 'provincia_id' => 1, 'localidad_id' => $faker->biasedNumberBetween($min = 1, $max = 34, $function = 'sqrt'), 'email_solicitud' => $faker->email, 'email_envio' => $faker->email, 'web' => $faker->url, 'facebook' => $faker->url, 'telefono1' => $faker->randomElement(['615324789', '928276589', '627456896', '615856912']), 'telefono2' => $faker->randomElement(['', '', '928278956', '928564285']), 'tipo_comunicacion_preferida_id' => rand(1, 2), 'observaciones' => $faker->text($maxNbChars = 200)];
 }
开发者ID:antoniobec,项目名称:palencia,代码行数:4,代码来源:ComunidadesTableSeeder.php

示例12: getDummyData

 public function getDummyData(Generator $faker, array $customValues = array())
 {
     $fecha_inicio = Carbon::createFromDate(2016, 1, 1)->addMonth(rand(0, 11))->addDay(rand(0, 31));
     $fecha_final = Carbon::createFromDate($fecha_inicio->year, $fecha_inicio->month, $fecha_inicio->day)->addDay(rand(0, 3));
     return ['cursillo' => $faker->catchPhrase, 'fecha_inicio' => $fecha_inicio, 'fecha_final' => $fecha_final, 'descripcion' => $faker->text($maxNbChars = 200), 'comunidad_id' => $this->getRandom('Comunidades')->id, 'tipo_participante_id' => rand(1, 3), 'num_cursillo' => rand(1111, 9999)];
 }
开发者ID:antoniobec,项目名称:palencia,代码行数:6,代码来源:CursillosTableSeeder.php

示例13: __invoke

 public function __invoke(Generator $oFaker)
 {
     return [\App\Models\Messages\Message::COLUMN_TEXT => $oFaker->text(200)];
 }
开发者ID:samcrosoft,项目名称:MicroTranslate,代码行数:4,代码来源:MessageModelFactory.php

示例14: title

 /**
  * Generate a title
  *
  * @param   int $maxChars   Maximum character length of the title
  * @return  string
  */
 public function title($maxChars = 50)
 {
     return trim($this->faker->text($maxChars), '.');
 }
开发者ID:alobimday,项目名称:IPS-Faker,代码行数:10,代码来源:Generator.php

示例15: generateList

 protected function generateList(array $data = [])
 {
     $data = array_merge(['name' => $this->faker->text(20), 'contact' => ['company' => $this->faker->company, 'address1' => $this->faker->streetAddress, 'address2' => $this->faker->secondaryAddress, 'city' => $this->faker->city, 'state' => $this->faker->state, 'zip' => $this->faker->postcode, 'country' => 'US', 'phone' => $this->faker->phoneNumber], 'permission_reminder' => $this->faker->text(50), 'use_archive_bar' => false, 'campaign_defaults' => ['from_name' => $this->faker->name, 'from_email' => $this->faker->email, 'subject' => $this->faker->sentence(5), 'language' => 'en'], 'notify_on_subscribe' => '', 'notify_on_unsubscribe' => '', 'email_type_option' => false, 'visibility' => 'pub'], $data);
     return $data;
 }
开发者ID:digital-canvas,项目名称:mailchimp-api,代码行数:5,代码来源:MailchimpTestTrait.php


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