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


PHP Generator::sentences方法代碼示例

本文整理匯總了PHP中Faker\Generator::sentences方法的典型用法代碼示例。如果您正苦於以下問題:PHP Generator::sentences方法的具體用法?PHP Generator::sentences怎麽用?PHP Generator::sentences使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Faker\Generator的用法示例。


在下文中一共展示了Generator::sentences方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testSave

 /**
  * @covers \Glue\Storage\Index::save
  */
 public function testSave()
 {
     $data = implode(' ', $this->faker->sentences());
     $result = $this->index->save($this->faker->uuid, $this->testData['length'], strlen($data));
     $this->assertNotEquals(false, $result);
     $this->assertInternalType('int', $result);
 }
開發者ID:iborodikhin,項目名稱:php-glue,代碼行數:10,代碼來源:IndexTest.php

示例2: testSave

 /**
  * @covers \Glue\Storage::save
  */
 public function testSave()
 {
     $data = implode(' ', $this->faker->sentences());
     $result = $this->storage->save($this->faker->uuid, $data);
     $this->assertNotEquals(false, $result);
     $this->assertInternalType('int', $result);
     $this->assertEquals(strlen($data), $result);
 }
開發者ID:iborodikhin,項目名稱:php-glue,代碼行數:11,代碼來源:StorageTest.php

示例3: setUp

 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->filename = sys_get_temp_dir() . '/' . time();
     $this->blob = new Blob($this->filename);
     $this->faker = FakerFactory::create();
     $this->faker->addProvider(new Provider\Internet($this->faker));
     $this->faker->addProvider(new Provider\DateTime($this->faker));
     $data = implode(' ', $this->faker->sentences());
     $length = strlen($data);
     $result = $this->blob->save($data);
     $this->testData = array('offset' => $result[0], 'length' => $length, 'data' => $data);
 }
開發者ID:iborodikhin,項目名稱:php-glue,代碼行數:16,代碼來源:BlobTest.php

示例4: configureOptions

 /**
  * {@inheritdoc}
  */
 protected function configureOptions(OptionsResolver $resolver)
 {
     $resolver->setDefault('title', function (Options $options) {
         return $this->faker->words(3, true);
     })->setDefault('rating', function (Options $options) {
         return $this->faker->numberBetween(1, 5);
     })->setDefault('comment', function (Options $options) {
         return $this->faker->sentences(3, true);
     })->setDefault('author', LazyOption::randomOne($this->customerRepository))->setNormalizer('author', LazyOption::findOneBy($this->customerRepository, 'email'))->setDefault('product', LazyOption::randomOne($this->productRepository))->setNormalizer('product', LazyOption::findOneBy($this->productRepository, 'code'))->setDefault('status', null);
 }
開發者ID:NeverResponse,項目名稱:Sylius,代碼行數:13,代碼來源:ProductReviewExampleFactory.php

示例5: description

 /**
  * Generate a description
  *
  * @param   int $maxSentences
  * @return  string
  */
 public function description($maxSentences = 3)
 {
     return $this->faker->sentences(mt_rand(1, $maxSentences), TRUE);
 }
開發者ID:alobimday,項目名稱:IPS-Faker,代碼行數:10,代碼來源:Generator.php


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