GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

MatcherSpec   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
lcom 1
cbo 3
dl 0
loc 52
rs 10
c 1
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 15 1
A it_is_initializable() 0 4 1
A it_implements_Yoqut_matcher_interface() 0 4 1
A it_should_not_throw_exception_if_gateway_is_valid() 0 6 1
A it_should_match_gateway_if_it_exists() 0 9 1
A it_should_support_valid_gateway() 0 4 1
1
<?php
2
3
namespace spec\Yoqut\Component\Sms\Gateway;
4
5
use PhpSpec\ObjectBehavior;
6
use Yoqut\Component\Sms\Model\SmsInterface;
7
use Yoqut\Component\Sms\Model\GatewayInterface;
8
use Yoqut\Component\Sms\Model\Sms;
9
use Yoqut\Component\Sms\Model\Gateway;
10
11
class MatcherSpec extends ObjectBehavior
12
{
13
    protected $gateways;
14
15
    function let()
16
    {
17
        $gateway = new Gateway(
18
            'localhost',
19
            2775,
20
            0x34,
21
            'username',
22
            'password',
23
            array('5555'),
24
            array('+555')
25
        );
26
27
        $this->gateways = array($gateway);
28
        $this->beConstructedWith($this->gateways);
29
    }
30
31
    function it_is_initializable()
32
    {
33
        $this->shouldHaveType('Yoqut\Component\Sms\Gateway\Matcher');
34
    }
35
36
    function it_implements_Yoqut_matcher_interface()
37
    {
38
        $this->shouldImplement('Yoqut\Component\Sms\Gateway\MatcherInterface');
39
    }
40
41
    function it_should_not_throw_exception_if_gateway_is_valid(SmsInterface $sms, GatewayInterface $gateway)
42
    {
43
        $this
44
            ->shouldNotThrow('Yoqut\Component\Sms\Gateway\Exception\InvalidGatewayException')
45
            ->duringMatch($sms, $gateway);
46
    }
47
48
    function it_should_match_gateway_if_it_exists()
49
    {
50
        $sms = new Sms();
51
        $sms->setSender('sender');
52
        $sms->setRecipient('+5550100');
53
        $sms->setMessage('message');
54
55
        $this->match($sms)->shouldNotReturn(null);
56
    }
57
58
    function it_should_support_valid_gateway(GatewayInterface $gateway)
59
    {
60
        $this->supports($gateway)->shouldReturn(true);
61
    }
62
}
63