Files
pest/tests/Features/BeforeEach.php
Nuno Maduro 26a6e7d712 More tests
2023-07-01 10:31:26 +01:00

28 lines
420 B
PHP

<?php
beforeEach(function () {
$this->bar = 2;
});
beforeEach(function () {
$this->bar++;
});
beforeEach(function () {
$this->bar = 0;
});
it('gets executed before each test', function () {
expect($this->bar)->toBe(1);
$this->bar = 'changed';
});
it('gets executed before each test once again', function () {
expect($this->bar)->toBe(1);
});
beforeEach(function () {
$this->bar++;
});