Files
pest/tests/Features/BeforeAll.php
Nuno Maduro 45cce6ce93 Style
2024-07-24 21:54:52 +01:00

19 lines
337 B
PHP

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