Beispiel #1
0
 /**
  * @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);
 }
Beispiel #2
0
 /**
  * @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);
 }
Beispiel #3
0
 /**
  * {@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);
 }
 /**
  * {@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);
 }
Beispiel #5
0
 /**
  * Generate a description
  *
  * @param   int $maxSentences
  * @return  string
  */
 public function description($maxSentences = 3)
 {
     return $this->faker->sentences(mt_rand(1, $maxSentences), TRUE);
 }