Completed
Push — master ( 0f7b01...b73efb )
by Bukashk0zzz
02:11
created

OfferSimpleGeneratorTest::createOffers()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 25
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 8.8571
c 0
b 0
f 0
cc 2
eloc 20
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\OfferSimple;
15
16
/**
17
 * Generator test
18
 *
19
 * @author Denis Golubovskiy <[email protected]>
20
 */
21
class OfferSimpleGeneratorTest extends AbstractGeneratorTest
22
{
23
    /**
24
     * Test generate
25
     */
26
    public function testGenerate()
27
    {
28
        $this->offerType = 'Simple';
29
        $this->runGeneratorTest();
30
    }
31
32
    /**
33
     * @return array
34
     */
35
    protected function createOffers()
36
    {
37
        $offers = [];
38
        foreach (range(1, 5) as $offer) {
39
            $offers[] = (new OfferSimple())
40
                ->setId($offer)
41
                ->setName($this->faker->name)
42
                ->setAvailable($this->faker->boolean)
43
                ->setUrl($this->faker->url)
44
                ->setPrice($this->faker->numberBetween(1, 9999))
45
                ->setCurrencyId('UAH')
46
                ->setCategoryId(1)
47
                ->setName($this->faker->name)
48
                ->setDelivery($this->faker->boolean)
49
                ->setLocalDeliveryCost($this->faker->numberBetween(1, 9999))
50
                ->setVendor($this->faker->company)
51
                ->setVendorCode($this->faker->companySuffix)
52
                ->setDescription($this->faker->sentence)
53
                ->setCountryOfOrigin('Украина')
54
                ->setAdult($this->faker->boolean)
55
            ;
56
        }
57
58
        return $offers;
59
    }
60
}
61