1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

BadMethodCallException: Call to undefined method...

Discussão em 'Outras Linguagens' iniciado por Drew Gallagher, Novembro 5, 2024 às 12:12.

  1. Getting this error with a unit test

    1) DeletePulseMutationTest::testDeletePulseDeletesCorrectResources
    BadMethodCallException: Call to undefined method Database\Factories\PulseAnswerFactory::getRelated()


    Here is the code that is failing in my unit test

    Pulse::factory()->create([
    'pulse_period_start_date' => '2021-01-01',
    'pulse_period_end_date' => '2021-01-31',
    'submitted_by_id' => $submitter,
    'reviewed_by_id' => $reviewer,
    'reviewed_at' => '2021-02-01'
    ])->has(
    PulseAnswer::factory()->count(1)
    ->has(PulseReply::factory()->count(1))
    );


    I'm using Laravel version 11.28 and following these docs https://laravel.com/docs/11.x/eloquent-factories#factory-relationships

    Continue reading...

Compartilhe esta Página