Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 22, 2022 01:18 pm GMT

Testing in Laravel

Great news, I found this article https://laravel-news.com/how-to-start-testing that explains simple steps for everyone who wants to enter the world of Testing in Laravel by PHPUnit and PEST and delve deeper into it, and this article will only put you on the first path and I will not talk much about the importance of Testing.

  • PEST: New Popular Alternative to PHPUnit
namespace Tests\Feature;use Illuminate\Foundation\Testing\RefreshDatabase;use Tests\TestCase;class ExampleTest extends TestCase{    public function test_the_application_returns_a_successful_response()    {        $response = $this->get('/');        $response->assertStatus(200);    }}

Do you know how the same test would look with PEST

test('the application returns a successful response')->get('/')->assertStatus(200);

I hope you enjoyed with me and to learn more about this release visit the sources and search more. I adore you who search for everything new.


Original Link: https://dev.to/morcosgad/testing-in-laravel-2442

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To