dimanche 23 septembre 2018

Why I got 404 report in Laravel feature testing

I need code example of feature laravel HTTP testing for multiple update method. Update(PUT methode) has 3 parametars (name, mail and password). I coded for "get","crete" and "delete", but I got difficulties with update. I don't have any idea from where I should need to start code. So, i will be thankful if anybody an help me with it, eve with hint,idea or example. `Code looks like this (but I think that is completely useless)

 Class UserRoutesTest extends TestCase 
 {

  public function test_update()
  {
   $response= $this->json('GET', 'my_route');

   $update = $this->json('PUT', 'my_route' . $user->id, [
         'name'='updatedname', 'email' => 'updatedemail', 
         'password'=>'updatedpassword'
          ]);

    $update->assertStatus(200);
    $update->assertJson([
 '  status' => 'success'
    ]);

   }   
 }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire