Completed
Push — master ( 2ad467...7fcbe3 )
by Guillaume
05:11
created

FormAuthStrategyTest::testGetToken()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 7

Duplication

Lines 14
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 14
loc 14
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace Eljam\GuzzleJwt\Tests\Strategy\Auth;
4
5
use Eljam\GuzzleJwt\Strategy\Auth\FormAuthStrategy;
6
7
/**
8
 * @author Guillaume Cavavana <[email protected]>
9
 */
10 View Code Duplication
class FormAuthStrategyTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Duplication introduced by
This class 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...
11
{
12
    /**
13
     * testGetToken.
14
     */
15
    public function testGetToken()
16
    {
17
        $authStrategy = new FormAuthStrategy(
18
            [
19
                'username' => 'admin',
20
                'password' => 'admin',
21
                'form_fields' => ['login', 'password'],
22
            ]
23
        );
24
25
        $this->assertTrue(array_key_exists('login', $authStrategy->getGuzzleRequestOptions()['form_params']));
26
27
        $this->assertTrue(array_key_exists('password', $authStrategy->getGuzzleRequestOptions()['form_params']));
28
    }
29
}
30