for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Tests\integration;
class AuthLoginTest extends BaseTestCase
{
/**
* Test user login endpoint and get a JWT Bearer Authorization.
*/
public function testLogin(): void
$response = $this->runApp('POST', '/login', ['email' => '[email protected]', 'password' => 'AnyPass1000']);
$result = (string) $response->getBody();
self::$jwt = json_decode($result)->message->Authorization;
$this->assertEquals(200, $response->getStatusCode());
$this->assertEquals('application/json', $response->getHeaderLine('Content-Type'));
$this->assertStringContainsString('Authorization', $result);
$this->assertStringContainsString('Bearer', $result);
}