mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
Add ability to define multiple hooks for the same directory in Pest.php
This commit is contained in:
committed by
Nuno Maduro
parent
9c077ed352
commit
9d58e1a77e
@ -1,15 +1,6 @@
|
||||
<?php
|
||||
|
||||
uses()->beforeEach(function () {
|
||||
expect($this)
|
||||
->toHaveProperty('baz')
|
||||
->and($this->baz)
|
||||
->toBe(0);
|
||||
|
||||
$this->baz = 1;
|
||||
});
|
||||
|
||||
beforeEach(function () {
|
||||
expect($this)
|
||||
->toHaveProperty('baz')
|
||||
->and($this->baz)
|
||||
@ -18,9 +9,18 @@ beforeEach(function () {
|
||||
$this->baz = 2;
|
||||
});
|
||||
|
||||
test('global beforeEach execution order', function () {
|
||||
beforeEach(function () {
|
||||
expect($this)
|
||||
->toHaveProperty('baz')
|
||||
->and($this->baz)
|
||||
->toBe(2);
|
||||
|
||||
$this->baz = 3;
|
||||
});
|
||||
|
||||
test('global beforeEach execution order', function () {
|
||||
expect($this)
|
||||
->toHaveProperty('baz')
|
||||
->and($this->baz)
|
||||
->toBe(3);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user