Test Failed
Branch develop (7f369c)
by Nicolas
04:26
created

WebTestCase::createAuthenticatedApiClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 6
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
    protected function createAnonymousApiClient()
16
    {
17
        return static::createClient([], [
18
            '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
    protected function createAuthenticatedApiClient($user = '[email protected]', $password = 'password')
29
    {
30
        return $this->createClient([], [
31
            'CONTENT_TYPE' => 'application/json',
32
            'PHP_AUTH_USER' => $user,
33
            'PHP_AUTH_PW' => $password,
34
        ]);
35
    }
36
}
37