Completed
Push — scalar-types/theme ( 924afa...015c58 )
by Kamil
24:18
created

ContactEmailManagerSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_implements_a_contact_email_manager_interface() 0 4 1
B it_sends_a_contact_request_email() 0 26 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
declare(strict_types=1);
13
14
namespace spec\Sylius\Bundle\ShopBundle\EmailManager;
15
16
use PhpSpec\ObjectBehavior;
17
use Sylius\Bundle\ShopBundle\EmailManager\ContactEmailManagerInterface;
18
use Sylius\Component\Mailer\Sender\SenderInterface;
19
20
/**
21
 * @author Grzegorz Sadowski <[email protected]>
22
 */
23
final class ContactEmailManagerSpec extends ObjectBehavior
24
{
25
    function let(SenderInterface $sender): void
26
    {
27
        $this->beConstructedWith($sender);
28
    }
29
30
    function it_implements_a_contact_email_manager_interface(): void
31
    {
32
        $this->shouldImplement(ContactEmailManagerInterface::class);
33
    }
34
35
    function it_sends_a_contact_request_email(SenderInterface $sender): void
36
    {
37
        $sender
38
            ->send(
39
                'contact_request',
40
                ['[email protected]'],
41
                [
42
                    'data' => [
43
                        'email' => '[email protected]',
44
                        'message' => 'Hello!',
45
                    ],
46
                ]
47
            )
48
            ->shouldBeCalled()
49
        ;
50
51
        $this
52
            ->sendContactRequest(
53
                [
54
                    'email' => '[email protected]',
55
                    'message' => 'Hello!',
56
                ],
57
                ['[email protected]']
58
            )
59
        ;
60
    }
61
}
62