Passed
Push — master ( 7fc19c...13cdec )
by Toby
04:11 queued 10s
created

v0AuthenticatorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 14
dl 0
loc 36
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testValidatesAuthParameters() 0 9 1
A setUp() 0 8 1
1
<?php
2
/**
3
 * v0Authenticator Test
4
 */
5
namespace Twigger\UnionCloud\Tests\Framework;
6
7
use Twigger\UnionCloud\API\Auth\v0Authenticator;
8
use Twigger\UnionCloud\Tests\TestCase;
9
10
/**
11
 * Class v0AuthenticatorTest
12
 *
13
 * @package Twigger\UnionCloud\Tests\Authentication
14
 */
15
class v0AuthenticatorTest extends TestCase
16
{
17
18
    /**
19
     * Holds an authenticator class
20
     *
21
     * @var v0Authenticator
22
     */
23
    private $authenticator;
24
25
    /**
26
     * Create a new authenticator
27
     */
28
    public function setUp()
29
    {
30
        $this->authenticator = new v0Authenticator();
31
        $this->authenticator->setParameters([
32
            'email' => $_ENV['EMAIL'],
33
            'password' => $_ENV['PASSWORD'],
34
            'appID' => $_ENV['APPID'],
35
            'appPassword' => $_ENV['EMAIL'],
36
        ]);
37
    }
38
39
    /**
40
     * Tests the validateParameters method of the v0 authenticator
41
     */
42
    public function testValidatesAuthParameters()
43
    {
44
        $parameters = [
45
            'email' => $_ENV['EMAIL'],
46
            'password' => $_ENV['PASSWORD'],
47
            'appID' => $_ENV['APPID'],
48
            'appPassword' => $_ENV['EMAIL'],
49
        ];
50
        $this->assertTrue($this->authenticator->validateParameters($parameters));
51
    }
52
53
}