• Czas czytania ~0 min
  • 07.04.2023

Pest Laravel Expectations to wtyczka Pest, która dodaje specyficzne dla Laravel oczekiwania do ekosystemu testowego:

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:

  • Uwierzytelnianie
  • Zbiory
  • Baza danych
  • Wyjątki
  • Modele
  • Odpowiedź
  • Składowanie
  • Godzina
  • Widoki

Aby rozpocząć, zapoznaj się z dokumentacją , aby uzyskać pełną listę oczekiwań z przykładami. Możesz również uzyskać pełny kod źródłowy na defstudio/pest-plugin-laravel-expectations.

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

O

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...

O autorze CrazyBoy49z
WORK EXPERIENCE
Kontakt
Ukraine, Lutsk
+380979856297