Skip to content

Instantly share code, notes, and snippets.

@mihaichris
Last active January 7, 2023 12:31
Show Gist options
  • Save mihaichris/02bb95cc3f5fc11a6139163a4f2610a8 to your computer and use it in GitHub Desktop.
Save mihaichris/02bb95cc3f5fc11a6139163a4f2610a8 to your computer and use it in GitHub Desktop.
Pest Unit Test
<?php
namespace GoodDay;
use Greetings\HelloWordService;
beforeEach(function () {
$this->helloService = new HelloWordService();
});
it('should say Hello World!', function () {
$this->assertSame('Hello World!', $this->helloService->sayHelloWorld());
})->group('greetings');
test('greet friends', function (string $name) {
$this->assertSame("Hello $name!", $this->helloService->sayHelloTo($name));
})->with(['Ana', 'John', 'Marius'])->group('greetings');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment