AbstractWebSMSTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDrivers() 0 7 1
A getMessageMock() 0 11 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Pavel
5
 * Date: 2015-05-14
6
 * Time: 00:06
7
 */
8
9
namespace ScayTrase\WebSMS\Tests;
10
11
use ScayTrase\WebSMS\Driver\FormDriver;
12
use ScayTrase\WebSMS\Driver\JsonDriver;
13
use ScayTrase\WebSMS\Message\MessageInterface;
14
15
abstract class AbstractWebSMSTest extends \PHPUnit_Framework_TestCase
16
{
17
    const FAKE_PHONE_0 = '+79994567890';
18
    const FAKE_PHONE_1 = '+79994567891';
19
    const FAKE_PHONE_2 = '+79994567892';
20
21
    public function getDrivers()
22
    {
23
        return array(
24
            'JSON Driver' => array(new JsonDriver()),
25
            'Form Driver' => array(new FormDriver()),
26
        );
27
    }
28
29
    /** @return MessageInterface */
30
    protected function getMessageMock()
31
    {
32
        $messageMock = $this->getMock('ScayTrase\WebSMS\Message\MessageInterface');
33
        $messageMock
34
            ->expects($this->any())->method('getRecipient')->willReturn(self::FAKE_PHONE_0);
35
        $messageMock
36
            ->expects($this->any())->method('getMessage')->willReturn('test message');
37
38
        return $messageMock;
39
40
    }
41
}
42