Completed
Pull Request — master (#28)
by
unknown
01:21
created

OfferDeliveryOptionsGeneratorTest::createOffer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.7
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\Delivery;
15
use Bukashk0zzz\YmlGenerator\Model\Offer\OfferSimple;
16
17
/**
18
 * Generator test
19
 */
20
class OfferDeliveryOptionsGeneratorTest extends AbstractGeneratorTest
21
{
22
    /**
23
     * Test generate
24
     */
25
    public function testGenerate()
26
    {
27
        $this->offerType = 'OfferDeliveryOptions';
28
        $this->runGeneratorTest();
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    protected function createOffer()
35
    {
36
        return (new OfferSimple())
37
            ->setName($this->faker->name)
38
            ->setVendor($this->faker->company)
39
            ->setVendorCode(null)
40
            ->setPickup(true)
41
            ->addDeliveryOption(
42
                (new Delivery)->setCost(10)->setDays(1)->setOrderBefore(14)
43
                )
44
            ->setGroupId($this->faker->numberBetween())
45
            ->addPicture('http://example.com/example.jpeg')
46
            ->addBarcode($this->faker->ean13)
47
            ->setCategoriesId([1, 2, 3])
48
            ->setCategoryId(999)
49
        ;
50
    }
51
}
52