Files
pest/tests/Features/BeforeAll.php
T
2026-07-18 01:10:01 +01:00

19 lines
354 B
PHP

<?php
$foo = new stdClass;
$foo->bar = 0;
beforeAll(function () use ($foo): void {
$foo->bar++;
});
it('gets executed before tests', function () use ($foo): void {
expect($foo)->bar->toBe(1);
$foo->bar = 'changed';
});
it('do not get executed before each test', function () use ($foo): void {
expect($foo)->bar->toBe('changed');
});