AuthLoginTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testLogin() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests\integration;
6
7
class AuthLoginTest extends BaseTestCase
8
{
9
    /**
10
     * Test user login endpoint and get a JWT Bearer Authorization.
11
     */
12
    public function testLogin(): void
13
    {
14
        $response = $this->runApp('POST', '/login', ['email' => '[email protected]', 'password' => 'AnyPass1000']);
15
16
        $result = (string) $response->getBody();
17
18
        self::$jwt = json_decode($result)->message->Authorization;
19
20
        $this->assertEquals(200, $response->getStatusCode());
21
        $this->assertEquals('application/json', $response->getHeaderLine('Content-Type'));
22
        $this->assertStringContainsString('Authorization', $result);
23
        $this->assertStringContainsString('Bearer', $result);
24
    }
25
}
26