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 spec\Sylius\Behat\Context\Setup; |
13
|
|
|
|
14
|
|
|
use Behat\Behat\Context\Context; |
15
|
|
|
use PhpSpec\ObjectBehavior; |
16
|
|
|
use Sylius\Component\Addressing\Model\ZoneInterface; |
17
|
|
|
use Sylius\Component\Core\Model\ChannelInterface; |
18
|
|
|
use Sylius\Component\Core\Test\Services\DefaultStoreDataInterface; |
19
|
|
|
use Sylius\Component\Core\Test\Services\SharedStorageInterface; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @author Arkadiusz Krakowiak <[email protected]> |
23
|
|
|
*/ |
24
|
|
|
class ChannelContextSpec extends ObjectBehavior |
25
|
|
|
{ |
26
|
|
|
function let(SharedStorageInterface $sharedStorage, DefaultStoreDataInterface $defaultFranceChannelFactory) |
27
|
|
|
{ |
28
|
|
|
$this->beConstructedWith($sharedStorage, $defaultFranceChannelFactory); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
function it_is_initializable() |
32
|
|
|
{ |
33
|
|
|
$this->shouldHaveType('Sylius\Behat\Context\Setup\ChannelContext'); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
function it_implements_context_interface() |
37
|
|
|
{ |
38
|
|
|
$this->shouldImplement(Context::class); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
function it_sets_default_channel_in_the_shared_storage( |
42
|
|
|
SharedStorageInterface $sharedStorage, |
43
|
|
|
DefaultStoreDataInterface $defaultFranceChannelFactory, |
44
|
|
|
ChannelInterface $channel, |
45
|
|
|
ZoneInterface $zone |
46
|
|
|
) { |
47
|
|
|
$defaultData = ['channel' => $channel, 'zone' => $zone]; |
48
|
|
|
$defaultFranceChannelFactory->create()->willReturn($defaultData); |
49
|
|
|
$sharedStorage->setClipboard($defaultData)->shouldBeCalled(); |
50
|
|
|
|
51
|
|
|
$this->thatStoreIsOperatingOnASingleChannel(); |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
|