Completed
Push — master ( b73efb...175f05 )
by Bukashk0zzz
03:39
created

OfferCustomGeneratorTest::createOffers()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 35
Code Lines 29

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 8.8571
c 0
b 0
f 0
cc 2
eloc 29
nc 2
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\OfferCustom;
15
use Bukashk0zzz\YmlGenerator\Model\Offer\OfferParam;
16
17
/**
18
 * Generator test
19
 *
20
 * @author Denis Golubovskiy <[email protected]>
21
 */
22
class OfferCustomGeneratorTest extends AbstractGeneratorTest
23
{
24
    /**
25
     * Test generate
26
     */
27
    public function testGenerate()
28
    {
29
        $this->offerType = 'Custom';
30
        $this->runGeneratorTest();
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    protected function createOffer()
37
    {
38
        return (new OfferCustom())
39
            ->setTypePrefix($this->faker->colorName)
40
            ->setVendor($this->faker->company)
41
            ->setVendorCode($this->faker->companySuffix)
42
            ->setModel($this->faker->userName)
43
            ->addParam(
44
                (new OfferParam())
45
                    ->setName($this->faker->name)
46
                    ->setUnit($this->faker->text(5))
47
                    ->setValue($this->faker->text(10))
48
            )
49
        ;
50
    }
51
}
52