tests/Controller/LoginControllerTest.php
/**
     * Test POST /login 200 OK
     */
Test POST /login 200 OK
Test POST / login 200 OK
public function testPostLogin200(): void
    {
        $data = [
            'username' => self::$writer['username'],
            'password' => self::$writer['password']
        ];
        $response = $this->runApp(
            'POST',
            self::$ruta_base,
            $data
        );
        self::assertSame(200, $response->getStatusCode());
        self::assertJson((string) $response->getBody());
        $r_body = (string) $response->getBody();
        self::assertTrue($response->hasHeader('Authorization'));
        $r_data = json_decode($r_body, true);
        self::assertNotEmpty($r_data['access_token']);
    }
public function testPostLogin200 ( ) : void { $ data = [ 'username' => self :: $ writer [ 'username' ] , 'password' => self :: $ writer [ 'password' ] ] ; $ response = $ this -> runApp ( 'POST' , self :: $ ruta_base , $ data ) ; self :: assertSame ( 200 , $ response -> getStatusCode ( ) ) ; self :: assertJson ( ( string ) $ response -> getBody ( ) ) ; $ r_body = ( string ) $ response -> getBody ( ) ; self :: assertTrue ( $ response -> hasHeader ( 'Authorization' ) ) ; $ r_data = json_decode ( $ r_body , true ) ; self :: assertNotEmpty ( $ r_data [ 'access_token' ] ) ; }
Test POST /login 200 OK
Test POST / login 200 OK