adnan483
3 months ago

Laravel testing

Posted 3 months ago by adnan483

hi, I'm new to testing, and I have there three tests, but they are not working, what is wrong here?

/** @test */
  public function can_add_new_company()
    {
        $data = [
            'name' => 'Apple',
            'email' => '[email protected]',
            'website' => 'www.apple.com'
        ];
        $this
            ->post(route('company.store', $data))
            ->assertStatus(302);
    }

for editing

/** @test */
    public function can_update_the_company()
    {
        $company = factory(Company::class)->create();
        $data = ['name' => 'Edited NAME!'];
        $this
            ->put(route('company.update', $company->id), $data)
            ->assertStatus(302);
    }

and for deleting

/** @test */
    public function can_delete_the_company()
    {
        $company = factory(Company::class)->create();
        $this
            ->delete(route('company.destroy', $company->id))
            ->assertStatus(302);
    }

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