1 | <?php |
||
21 | class OfferCustomGeneratorTest extends AbstractGeneratorTest |
||
22 | { |
||
23 | /** |
||
24 | * Test generate |
||
25 | */ |
||
26 | public function testGenerate() |
||
27 | { |
||
28 | $this->offerType = 'Custom'; |
||
29 | $this->runGeneratorTest(); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | protected function createOffer() |
||
36 | { |
||
37 | return (new OfferCustom()) |
||
38 | ->setTypePrefix($this->faker->colorName) |
||
39 | ->setVendor($this->faker->company) |
||
40 | ->setVendorCode($this->faker->companySuffix) |
||
41 | ->setModel($this->faker->userName) |
||
42 | ->setGroupId($this->faker->numberBetween()) |
||
43 | ->setStore($this->faker->boolean) |
||
44 | ->addParam( |
||
45 | (new OfferParam()) |
||
46 | ->setName($this->faker->name) |
||
47 | ->setUnit($this->faker->text(5)) |
||
48 | ->setValue($this->faker->text(10)) |
||
49 | ) |
||
50 | ->setPictures(['http://example.com/example.jpeg', 'http://example.com/example2.jpeg']) |
||
51 | ->addCondition( |
||
52 | (new OfferCondition()) |
||
53 | ->setType($this->faker->text(5)) |
||
54 | ->setReasonText($this->faker->text(10)) |
||
55 | ) |
||
56 | ; |
||
57 | } |
||
58 | } |
||
59 |