Home > other >  Symfony - unit testing with Pest
Symfony - unit testing with Pest

Time:02-10

I'm totally new to unit testing in php. I'm trying to make a test case for user register Api. I don't know how to pass parameters for writing test. This is my code below.

<?php
//use function Pest\Laravel\get;
//use Tests\TestCase;
use Symfony\Component\HttpFoundation\Response;
use Illuminate\Foundation\Testing\RefreshDatabase;

it( 'shows the validation of inputs fields',function (){
    $client = new \GuzzleHttp\Client();
    $url = "http://le-tribe.local/";
    $url = $url.'api/v1/register';
    $response = $client->request('POST',$url, );

    $this->assertEquals(200,$response->getStatusCode());
});

CodePudding user response:

  •  Tags:  
  • Related