Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

167
Vistas
Testing Database using laravel dusk

I am testing my laravel application using laravel dusk but the problem is that I am unable to use assertDatabaseHasfunction. When I run php artisan dusk command I got this error:

PHP Fatal error:  Class 'PHPUnit_Framework_Constraint' not found in 
vendor\laravel\framework\src\Illuminate\Foundation\Testing\Constraints\HasIn
Database.php on line 8

enter image description here

Here is my code:

$this->assertDatabaseHas('teams', [
    'name' => $data['team_name'],
]);
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Please check your version of phpunit:

phpunit --version

If you are are running v6 you might have trouble because it expects a namespaced class. In that case you either have to switch to an older version of phpunit, e.g. locally installed for your project and then run like this:

php vendor/bin/phpunit --version

or you might have to update your Laravel-project, which is probably more work as you might have to change parts of your code.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda