本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例5: description
/**
* Generate a description
*
* @param int $maxSentences
* @return string
*/
public function description($maxSentences = 3)
{
return $this->faker->sentences(mt_rand(1, $maxSentences), TRUE);
}