当前位置: 首页>>代码示例>>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;未经允许,请勿转载。