mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
21 lines
418 B
PHP
21 lines
418 B
PHP
<?php
|
|
|
|
$state = new stdClass();
|
|
|
|
beforeEach(function () use ($state) {
|
|
$this->state = $state;
|
|
});
|
|
|
|
afterEach(function () {
|
|
$this->state->bar = 2;
|
|
});
|
|
|
|
it('does not get executed before the test', function () {
|
|
expect($this->state)->not->toHaveProperty('bar');
|
|
});
|
|
|
|
it('gets executed after the test', function () {
|
|
expect($this->state)->toHaveProperty('bar');
|
|
expect($this->state->bar)->toBe(2);
|
|
});
|