Completed
Push — master ( 230277...71b70e )
by Kamil
18:48
created

ChannelContext::storeShipsTo()   A

Complexity

Conditions 4
Paths 8

Size

Total Lines 16
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 16
rs 9.2
cc 4
eloc 8
nc 8
nop 3
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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 Sylius\Behat\Context\Setup;
13
14
use Behat\Behat\Context\Context;
15
use Sylius\Component\Core\Test\Services\DefaultStoreDataInterface;
16
use Sylius\Component\Core\Test\Services\SharedStorageInterface;
17
18
/**
19
 * @author Arkadiusz Krakowiak <[email protected]>
20
 * @author Mateusz Zalewski <[email protected]>
21
 */
22
final class ChannelContext implements Context
23
{
24
    /**
25
     * @var SharedStorageInterface
26
     */
27
    private $sharedStorage;
28
29
    /**
30
     * @var DefaultStoreDataInterface
31
     */
32
    private $defaultFranceChannelFactory;
33
34
    /**
35
     * @param SharedStorageInterface $sharedStorage
36
     * @param DefaultStoreDataInterface $defaultFranceChannelFactory
37
     */
38
    public function __construct(
39
        SharedStorageInterface $sharedStorage,
40
        DefaultStoreDataInterface $defaultFranceChannelFactory
41
    ) {
42
        $this->sharedStorage = $sharedStorage;
43
        $this->defaultFranceChannelFactory = $defaultFranceChannelFactory;
44
    }
45
46
    /**
47
     * @Given the store is operating on a single channel
48
     */
49
    public function thatStoreIsOperatingOnASingleChannel()
50
    {
51
        $defaultData = $this->defaultFranceChannelFactory->create();
52
        $this->sharedStorage->setClipboard($defaultData);
53
    }
54
}
55