mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
first
This commit is contained in:
18
tests/Features/BeforeAll.php
Normal file
18
tests/Features/BeforeAll.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
$foo = new \stdClass();
|
||||
$foo->bar = 0;
|
||||
|
||||
beforeAll(function () use ($foo) {
|
||||
$foo->bar++;
|
||||
});
|
||||
|
||||
it('gets executed before tests', function () use ($foo) {
|
||||
assertEquals($foo->bar, 1);
|
||||
|
||||
$foo->bar = 'changed';
|
||||
});
|
||||
|
||||
it('do not get executed before each test', function () use ($foo) {
|
||||
assertEquals($foo->bar, 'changed');
|
||||
});
|
||||
Reference in New Issue
Block a user