GuzzleConnectorTest::testConnectWithoutTokent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of Laravel SMSFactor.
5
 *
6
 * (c) Filippo Galante <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace IlGala\Tests\SMSFactor\Adapters;
13
14
use IlGala\SMSFactor\Adapters\GuzzleAdapter;
15
use IlGala\SMSFactor\Connectors\GuzzleConnector;
16
use GrahamCampbell\TestBench\AbstractTestCase;
17
18
/**
19
 * This is the guzzle connector test class.
20
 *
21
 * @author Filippo Galante <[email protected]>
22
 */
23
class GuzzleConnectorTest extends AbstractTestCase
24
{
25 View Code Duplication
    public function testConnectStandard()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
    {
27
        $connector = $this->getGuzzleConnector();
28
29
        $return = $connector->connect(['username' => 'your-username', 'password' => 'your-password', 'accept' => 'application/json']);
30
31
        $this->assertInstanceOf(GuzzleAdapter::class, $return);
32
    }
33
34
    /**
35
     * @expectedException \InvalidArgumentException
36
     * @expectedExceptionMessage The guzzle connector requires configuration.
37
     */
38
    public function testConnectWithoutTokent()
39
    {
40
        $connector = $this->getGuzzleConnector();
41
42
        $connector->connect([]);
43
    }
44
45
    protected function getGuzzleConnector()
46
    {
47
        return new GuzzleConnector();
48
    }
49
}
50