1
0
Fork 0
mirror of https://github.com/pnx/neotest-phpunit synced 2026-06-16 03:54:55 +02:00

Add more variety to the test calls

This commit is contained in:
Michael Utz 2022-11-15 14:37:59 +03:00
parent d6dd4fd598
commit 73ff438e9c

View file

@ -2,19 +2,25 @@
use TestProject\User;
uses()->group('file group');
$makeUser = fn () => new User(18, 'John');
beforeEach(fn () => $this->sut = $makeUser());
test('class constructor')
->expect($makeUser)
->name->toBe('John')
->age->toBe(18)
->favorite_movies->toBeEmpty();
test('tellName')
->expect($makeUser)
->tellName()->toBeString()->toContain('John');
test('tellName', function () {
expect($this->sut)
->tellName()->toBeString()->toContain('John');
})
->group('special tests');
test('tellAge')
it('can tellAge')
->expect($makeUser)
->tellAge()->toBeString()->toContain('18');