Completed
Push — master ( 4fff23...13399c )
by Kamil
30:31
created

SharedStorageContextSpec   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 5
c 1
b 1
f 0
lcom 0
cbo 1
dl 0
loc 33
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_initializable() 0 4 1
A it_implements_context_interface() 0 4 1
A it_transforms_it_word_into_latest_resource() 0 6 1
A it_transform_this_that_and_the_with_resource_name_to_current_resource_of_this_type() 0 8 1
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\Transform;
13
14
use Behat\Behat\Context\Context;
15
use PhpSpec\ObjectBehavior;
16
use Sylius\Component\Core\Model\CustomerInterface;
17
use Sylius\Component\Core\Test\Services\SharedStorageInterface;
18
19
/**
20
 * @author Mateusz Zalewski <[email protected]>
21
 */
22
class SharedStorageContextSpec extends ObjectBehavior
23
{
24
    function let(SharedStorageInterface $sharedStorage)
25
    {
26
        $this->beConstructedWith($sharedStorage);
27
    }
28
29
    function it_is_initializable()
30
    {
31
        $this->shouldHaveType('Sylius\Behat\Context\Transform\SharedStorageContext');
32
    }
33
34
    function it_implements_context_interface()
35
    {
36
        $this->shouldImplement(Context::class);
37
    }
38
39
    function it_transforms_it_word_into_latest_resource($sharedStorage)
40
    {
41
        $sharedStorage->getLatestResource()->willReturn('string');
42
43
        $this->getLatestResource()->shouldReturn('string');
44
    }
45
46
    function it_transform_this_that_and_the_with_resource_name_to_current_resource_of_this_type(
47
        $sharedStorage,
48
        CustomerInterface $customer
49
    ) {
50
        $sharedStorage->get('customer')->willReturn($customer);
51
52
        $this->getResource('customer')->shouldReturn($customer);
53
    }
54
}
55