Completed
Push — master ( 9abbc7...a687e5 )
by Fabrizio
03:03
created

SenderFactorySpec::it_is_initializable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace spec\Fenos\Notifynder\Senders;
4
5
use Fenos\Notifynder\Contracts\NotifynderCategory;
6
use Fenos\Notifynder\Contracts\NotifynderGroup;
7
use Fenos\Notifynder\Senders\SendGroup;
8
use Fenos\Notifynder\Senders\SendMultiple;
9
use Fenos\Notifynder\Senders\SendOne;
10
use PhpSpec\ObjectBehavior;
11
12
class SenderFactorySpec extends ObjectBehavior
13
{
14
    public function let(NotifynderGroup $notifynderGroup, NotifynderCategory $notifynderCategory)
15
    {
16
        $this->beConstructedWith($notifynderGroup, $notifynderCategory);
17
    }
18
19
    public function it_is_initializable()
20
    {
21
        $this->shouldHaveType('Fenos\Notifynder\Senders\SenderFactory');
22
    }
23
24
    /** @test */
25
    public function it_get_a_dynamic_sender_checking_array_type_GET_SINGLE()
26
    {
27
        // if the array is multidimensional then
28
        // send multiple
29
        $notification = [];
30
        $category = 1;
31
32
        $this->getSender($notification, $category)->shouldReturnAnInstanceOf(SendOne::class);
33
    }
34
35
    /** @test */
36
    public function it_get_a_dynamic_sender_checking_array_type_GET_MULTIPLE()
37
    {
38
        // if the array is multidimensional then
39
        // send multiple
40
        $notification = [
41
            0 => [],
42
        ];
43
        $category = 1;
44
45
        $this->getSender($notification, $category)->shouldReturnAnInstanceOf(SendMultiple::class);
46
    }
47
48
    /** @test */
49
    public function it_get_the_send_group_sender()
50
    {
51
        $group_name = 'mygroup';
52
        $info = [];
53
54
        $this->sendGroup($group_name, $info)->shouldReturnAnInstanceOf(SendGroup::class);
55
    }
56
}
57