ZonerSmsGatewayTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: jarno
5
 * Date: 12.12.2017
6
 * Time: 11.04.
7
 */
8
9
namespace NotificationChannels\ZonerSmsGateway\IntegrationTest;
10
11
use GuzzleHttp\Client;
12
use PHPUnit\Framework\TestCase;
13
use NotificationChannels\ZonerSmsGateway\ZonerSmsGateway;
14
15
class ZonerSmsGatewayTest extends TestCase
16
{
17
    /** @var ZonerSmsGateway */
18
    protected $gateway;
19
    /** @var string */
20
    protected $numberTo;
21
22
    protected function setUp()
23
    {
24
        $dotenv = new \Dotenv\Dotenv(__DIR__);
25
        $dotenv->load();
26
27
        $username = getenv('ZONER_USERNAME');
28
        $password = getenv('ZONER_PASSWORD');
29
        $this->numberTo = getenv('ZONER_TEST_RECEIVER');
30
31
        $httpClient = new Client();
32
33
        $this->gateway = new ZonerSmsGateway($username, $password, 'zonertest', $httpClient);
34
    }
35
36
    /**
37
     * @test
38
     */
39
    public function sendsSms()
40
    {
41
        $tracking = $this->gateway->sendMessage($this->numberTo, 'hello zoner', 'zonertest');
42
        $this->assertNotEmpty($tracking);
43
    }
44
}
45