Passed
Push — master ( 9d91f5...63d5b5 )
by Bukashk0zzz
13:08
created

OfferCustomGeneratorTest::createOffer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 9.552
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Bukashk0zzzYmlGenerator
5
 *
6
 * (c) Denis Golubovskiy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Bukashk0zzz\YmlGenerator\Tests;
13
14
use Bukashk0zzz\YmlGenerator\Model\Offer\OfferCondition;
15
use Bukashk0zzz\YmlGenerator\Model\Offer\OfferCustom;
16
use Bukashk0zzz\YmlGenerator\Model\Offer\OfferParam;
17
18
/**
19
 * Generator test
20
 */
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