mirror of
https://github.com/pestphp/pest.git
synced 2026-03-10 09:47:23 +01:00
first
This commit is contained in:
27
tests/Features/TestCycle.php
Normal file
27
tests/Features/TestCycle.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?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);
|
||||
});
|
||||
Reference in New Issue
Block a user