mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
28 lines
564 B
PHP
28 lines
564 B
PHP
<?php
|
|
|
|
$foo = new stdClass();
|
|
$foo->beforeAll = false;
|
|
$foo->beforeEach = false;
|
|
$foo->afterEach = false;
|
|
$foo->afterAll = false;
|
|
|
|
beforeAll(function () {
|
|
$foo->beforeAll = true;
|
|
});
|
|
beforeEach(function () {
|
|
$foo->beforeEach = true;
|
|
});
|
|
afterEach(function () {
|
|
$foo->afterEach = true;
|
|
});
|
|
afterAll(function () {
|
|
$foo->afterAll = true;
|
|
});
|
|
|
|
register_shutdown_function(function () use ($foo) {
|
|
assertFalse($foo->beforeAll);
|
|
assertFalse($foo->beforeEach);
|
|
assertFalse($foo->afterEach);
|
|
assertFalse($foo->afterAll);
|
|
});
|