MessagesLoggerSpec   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 6 1
A it_should_store_a_given_message() 0 6 1
A it_should_get_messages_sent_to_a_specific_email() 0 8 1
1
<?php
2
3
namespace spec\Knp\RadBundle\Mailer;
4
5
use PhpSpec\ObjectBehavior;
6
7
class MessagesLoggerSpec extends ObjectBehavior
8
{
9
    /**
10
     * @param Knp\RadBundle\ObjectStore\ObjectStoreInterface $objStore
11
     * @param Swift_Mime_Message                             $a
12
     * @param Swift_Mime_Message                             $b
13
     * @param Swift_Mime_Message                             $c
14
     */
15
    function let($objStore, $a, $b, $c)
16
    {
17
        $this->beConstructedWith($objStore);
18
19
        $objStore->findAll()->willReturn(array($a, $b, $c));
20
    }
21
22
    function it_should_store_a_given_message($objStore, $a)
0 ignored issues
show
Coding Style introduced by
Method name "MessagesLoggerSpec::it_should_store_a_given_message" is not in camel caps format
Loading history...
23
    {
24
        $objStore->store($a)->shouldBeCalled();
25
26
        $this->storeMessage($a);
27
    }
28
29
    function it_should_get_messages_sent_to_a_specific_email($objStore, $a, $b, $c)
0 ignored issues
show
Unused Code introduced by
The parameter $objStore is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Coding Style introduced by
Method name "MessagesLoggerSpec::it_should_get_messages_sent_to_a_specific_email" is not in camel caps format
Loading history...
30
    {
31
        $a->getTo()->willReturn(array('[email protected]' => 'John'));
32
        $b->getTo()->willReturn(array('[email protected]' => 'Sarah'));
33
        $c->getTo()->willReturn(array('[email protected]' => 'George', '[email protected]' => ''));
34
35
        $this->getMessagesSentTo('[email protected]')->shouldReturn(array($a, $c));
36
    }
37
}
38