mirror of
https://github.com/pestphp/pest.git
synced 2026-03-05 23:37:22 +01:00
test: add tests for shared/global before each hooks
This commit is contained in:
11
tests/Hooks/BeforeEachTest.php
Normal file
11
tests/Hooks/BeforeEachTest.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
beforeEach(function (): void {
|
||||
expect($this->baz)->toBe(1); // set from Pest.php global/shared hook
|
||||
|
||||
$this->baz = 2;
|
||||
});
|
||||
|
||||
test('global before each', function (): void {
|
||||
expect($this->baz)->toBe(2);
|
||||
});
|
||||
@ -1,3 +1,6 @@
|
||||
<?php
|
||||
|
||||
uses()->group('integration')->in('Visual');
|
||||
uses()->beforeEach(function (): void {
|
||||
$this->baz = 1;
|
||||
})->in('Hooks');
|
||||
|
||||
Reference in New Issue
Block a user