собственно к класса User есть такие метод
public static function register(RegisterRequest $request):self
{
return static::create([
'name'=>$request->name,
'email'=>$request->email,
'password'=>bcrypt($request->password),
'verify_token' => Str::random(),
'status' => self::STATUS_WAIT,
]);
}
вот так пытаюсь его проверить
public function create():void
{
$user=User::register($this->request);
self::assertNotEmpty($user);
self::assertEquals($this->name,$user->name);
self::assertEquals($this->email,$user->email);
self::assertNotEmpty($user->password);
self::assertEquals($this->password,$user->password);
self::assertTrue($user->isWait());
self::assertFalse($user->isActive());
}
вот так создаю RegisterRequest
public function setUp(): void
{
parent::setUp();
$this->request= $this->createMock(RegisterRequest::class);
$this->request->name=$this->name;
$this->request->email=$this->email;
$this->request->password=$this->password;
}
получаю такую ошибку
Caused by
ReflectionException: Class hash does not exist
/www/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
/www/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:691
/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:796
/www/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:637
/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:781
/www/app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:119
/www/app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:205
/www/app/app/Entity/User.php:81
/www/app/tests/Unit/RegisterTest.php:69
собственно ругается на эту строку
'password'=>bcrypt($request->password),
в методе register Почему такое может быть ?