Passed
Branch develop (7f369c)
by Nicolas
04:24
created

WebTestCase::createAuthenticatedApiClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace App\Test;
4
5
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
6
7
/**
8
 * WebTestCase.
9
 */
10
class WebTestCase extends BaseWebTestCase
11
{
12
    /**
13
     * @return \Symfony\Bundle\FrameworkBundle\Client
14
     */
15 2
    protected function createAnonymousApiClient()
16
    {
17 2
        return static::createClient([], [
18 2
            'CONTENT_TYPE' => 'application/json',
19
        ]);
20
    }
21
22
    /**
23
     * @param string $user
24
     * @param string $password
25
     *
26
     * @return \Symfony\Bundle\FrameworkBundle\Client
27
     */
28 20
    protected function createAuthenticatedApiClient($user = '[email protected]', $password = 'password')
29
    {
30 20
        return $this->createClient([], [
31 20
            'CONTENT_TYPE' => 'application/json',
32 20
            'PHP_AUTH_USER' => $user,
33 20
            'PHP_AUTH_PW' => $password,
34
        ]);
35
    }
36
}
37