<commit_before><?php

class LoginInterfaceTest extends TestCase
{
    public $user;

    /**
     * Share views.
     */
    public function startTestSuite()
    {
        parent::startTestSuite();
        \View::share('errors', new \Illuminate\Support\ViewErrorBag());
        \View::share('mconsole_menu', app('API')->menu->get());
        \View::share('mconsole_options', \Milax\Mconsole\Models\MconsoleOption::getCached());
        \View::share('mconsole_changelog', 'Testing');
    }

    /**
     * Create test user.
     */
    public function setUp()
    {
        parent::setUp();
        $this->user = factory(App\User::class)->create([
            'role_id' => 1,
            'password' => <PASSWORD>('<PASSWORD>'),
        ]);
    }

    /**
     * Test if mconsole dashboard is working.
     */
    public function testDashboardIsWorking()
    {
        $this->actingAs($this->user)->visit('/mconsole')->see($this->user->name);
    }

    /**
     * Test if MconsoleMiddleware is working.
     */
    public function testLoginFail()
    {
        $this->assertTrue(true);

        $this->visit('/mconsole/login')
            ->type('test', 'login')
            ->type('test', 'password')
            ->press(trans('mconsole::login.buttons.login'))
            ->seePageis('/mconsole/login');
    }

    /**
     * Test user login success.
     */
    public function testLoginSuccess()
    {
        $this->assertTrue(true);

        $this->visit('/mconsole/login')
            ->type($this->user->email, 'login')
            ->type('testing', 'password')
            ->press(trans('mconsole::login.buttons.login'))
            ->seePageIs('/mconsole')
            ->see($this->user->name);
    }

    /**
     * Test user logout success.
     */
    public function testLogoutSuccess()
    {
        $this->assertTrue(true);

        $this->actingAs($this->user)
            ->visit('/mconsole/logout')
            ->seePageIs('/mconsole/login');
    }

    /**
     * Cleanup.<commit_msg>Fix LoginInterfaceTest<commit_after><?php

class LoginInterfaceTest extends TestCase
{
    public $user;

    /**
     * Share views.
     */
    public function startTestSuite()
    {
        parent::startTestSuite();
        \View::share('errors', new \Illuminate\Support\ViewErrorBag());
        \View::share('mconsole_menu', app('API')->menu->get());
        \View::share('mconsole_options', \Milax\Mconsole\Models\MconsoleOption::getCached());
        \View::share('mconsole_changelog', 'Testing');
    }

    /**
     * Create test user.
     */
    public function setUp()
    {
        parent::setUp();
        $this->user = factory(App\User::class)->create([
            'role_id' => 1,
            'password' => <PASSWORD>('<PASSWORD>'),
        ]);
    }

    /**
     * Test if mconsole dashboard is working.
     */
    public function testDashboardIsWorking()
    {
        $this->actingAs($this->user)->visit('/mconsole')->see($this->user->name);
    }

    /**
     * Test if MconsoleMiddleware is working.
     */
    public function testLoginFail()
    {
        $this->assertTrue(true);

        $this->visit('/mconsole/login')
            ->type('test', 'login')
            ->type('test', 'password')
            ->press(trans('mconsole::login.buttons.login'))
            ->seePageis('/mconsole/login');
    }

    /**
     * Test user login success.
     */
    public function testLoginSuccess()
    {
        $this->assertTrue(true);

        $this->visit('/mconsole/login')
            ->type($this->user->email, 'login')
            ->type('testing', 'password')
            ->press(trans('mconsole::login.buttons.login'))
            ->seePageIs('/mconsole/dashboard')
            ->see($this->user->name);
    }

    /**
     * Test user logout success.
     */
    public function testLogoutSuccess()
    {
        $this->assertTrue(true);

        $this->actingAs($this->user)
            ->visit('/mconsole/logout')
            ->seePageIs('/mconsole/login');
    }

    /**
     * Cleanup.
{'fraction_non_alphanumeric': 0.17863354037267082, 'fraction_numerical': 0.0004968944099378882, 'mean_word_length': 2.0384905660377357, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 75, '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': '5873467', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1169, 'n_words': 178}