abkrim
5 months ago
1077
11
Testing

[SOLVED] Upgrade system to PHP 7.4 fail only test for users

Posted 5 months ago by abkrim

Hi.

I'm desesperate.

Today upgrade my develop system to PHP 7.4. Well after upgrade, run test and I see fails on Users tests.

  1. I run test by folder (models) Domain, Mailboxes. All work fine
  2. Run test for users, and I get error.

Error?

Only user nas a problem, and there're using mysql database, instead sqlite in memory.

A simple test for verify problem

function a_super_admin_can_get_index_users()
    {
        Passport::actingAs(
            factory(User::class)->create(['is_super_admin' => true])
        );

        // factory(User::class, 15)->create();

        $response = $this->get('/api/v1/users');

        dd($response);  // For verify problem

        $response
            ->assertStatus(200)
            ->assertJsonCount(15, $key = 'data');
    }

Response show 28 users there're in Mysql database. Buty my test using sqlite.

Desesperate

Please sign in or create an account to participate in this conversation.