小编I. *_*rak的帖子

laravel错误调用未定义的方法Illuminate\Hashing\BcryptHasher :: driver()

我正在尝试测试我的laravel应用程序,运行phpunit,但得到一个错误:

Error: Call to undefined method Illuminate\Hashing\BcryptHasher::driver()
Run Code Online (Sandbox Code Playgroud)

laravel 5.5,PHPUnit 7.0

我的用户测试:

namespace Tests\Feature;

use App\User;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;

class UserTest extends TestCase
{
   use RefreshDatabase;

   /** @test */
   function name_should_not_be_too_long()
   {
      $response = $this->post('/users', [
          'name' => str_repeat('a', 51),
          'email' => $this->user->email,
          'password' => 'secret',
      ]);

      $response->assertStatus(302);
      $response->assertSessionHasErrors([
          'name' => 'The name may not be greater than 50 characters.'
      ]);
  }
Run Code Online (Sandbox Code Playgroud)

}

phpunit laravel

3
推荐指数
1
解决办法
1165
查看次数

标签 统计

laravel ×1

phpunit ×1