• Reading time ~ 1 min
  • 07.04.2023

Pest Laravel Expectations is a Pest plugin that adds Laravel-specific expectations to the testing ecosystem:

it('can check model exists', function(){
  $user = User::factory()->create();

  expect($user)->toExist();
});
test('user can edit a post', function(){
  $user = User::factory()->create();

  expect($user)->toBeAbleTo('edit', $post);
});

test('home is rendered', function () {
    $response = get('/home');

    expect($response)->toBeSuccessful();
});

This plugin includes different expectations across the following Laravel features:

  • Authentication
  • Collections
  • Database
  • Exceptions
  • Models
  • Response
  • Storage
  • Time
  • Views

To get started, check out the documentation for a complete list of expectations with examples. Also, you can get the full source code at defstudio/pest-plugin-laravel-expectations.

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

ABOUT

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

About author CrazyBoy49z
WORK EXPERIENCE
Contact
Ukraine, Lutsk
+380979856297