<commit_before><?php

namespace Tests\Feature;

use Tests\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;

use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Tymon\JWTAuth\Facades\JWTAuth;

class LoginControllerTest extends TestCase
{
    /**
     *
     */
    public function testLogin()
    {
        $userVerifiedData = [
            'email' => '<EMAIL>',
            'password' => <PASSWORD>('password'),
            'activated' => true
        ];

        $this->deleteUser($userVerifiedData);

        factory(User::class)->create($userVerifiedData);

        $response = $this->json('POST', '/api/v1/login',
            [
                'email' => $userVerifiedData['email'],
                'password' => 'password'
            ]
        );

        $response->assertStatus(200);
    }

    /**
     *
     */
    public function testLogout()
    {
        $userVerifiedData = [
            'email' => '<EMAIL>',
            'password' => <PASSWORD>('password'),
            'activated' => true
        ];

        $this->deleteUser($userVerifiedData);

        $user = factory(User::class)->create($userVerifiedData);

        $response = $this->actingAs($user, 'api')->json('GET', '/api/v1/logout',[], $this->headers($user));

        $response->assertStatus(200);
    }

}<commit_msg>Add test login error case<commit_after><?php

namespace Tests\Feature;

use Tests\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;

use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Tymon\JWTAuth\Facades\JWTAuth;

class LoginControllerTest extends TestCase
{
    /**
     *
     */
    public function testLogin()
    {
        $userVerifiedData = [
            'email' => '<EMAIL>',
            'password' => <PASSWORD>('password'),
            'activated' => true
        ];

        $this->deleteUser($userVerifiedData);

        factory(User::class)->create($userVerifiedData);

        $response = $this->json('POST', '/api/v1/login',
            [
                'email' => $userVerifiedData['email'],
                'password' => 'password'
            ]
        );

        $response->assertStatus(200);
    }

    /**
     *
     */
    public function testLoginError()
    {
        $userVerifiedData = [
            'email' => '<EMAIL>',
            'password' => <PASSWORD>::<PASSWORD>('password'),
            'activated' => true
        ];

        $this->deleteUser($userVerifiedData);

        factory(User::class)->create($userVerifiedData);

        $response = $this->json('POST', '/api/v1/login',
            [
                'email' => $userVerifiedData['email'],
                'password' => '<PASSWORD>'
            ]
        );

        $response->assertStatus(401);
    }
}
{'fraction_non_alphanumeric': 0.15583978458431505, 'fraction_numerical': 0.005385392123864019, 'mean_word_length': 2.2060409924487594, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5548300', 'n_tokens_mistral': 876, 'n_tokens_neox': 862, 'n_words': 125}