Completed
Push — master ( abb6bd...6375fb )
by Bukashk0zzz
01:10
created

OfferDeliveryOptionsGeneratorTest::testGenerate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
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
        $delivery = (new Delivery())->setCost(10)->setDays(1)->setOrderBefore(14);
37
38
        return (new OfferSimple())
39
            ->setName($this->faker->name)
40
            ->setVendor($this->faker->company)
41
            ->setVendorCode(null)
42
            ->setPickup(true)
43
            ->addDeliveryOption($delivery)
44
            ->addDeliveryOption($delivery)
45
            ->setGroupId($this->faker->numberBetween())
46
            ->addPicture('http://example.com/example.jpeg')
47
            ->addBarcode($this->faker->ean13)
48
            ->setCategoriesId([1, 2, 3])
49
            ->setCategoryId(999)
50
        ;
51
    }
52
}
53