mirror of
https://github.com/pestphp/pest.git
synced 2026-07-24 10:30:03 +02:00
fix: package lock fingerprint
This commit is contained in:
@@ -1,91 +1,91 @@
|
||||
<?php
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(function (): void {
|
||||
$this->bar = 2;
|
||||
});
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(function (): void {
|
||||
$this->bar++;
|
||||
});
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(function (): void {
|
||||
$this->bar = 0;
|
||||
});
|
||||
|
||||
it('gets executed before each test', function () {
|
||||
it('gets executed before each test', function (): void {
|
||||
expect($this->bar)->toBe(1);
|
||||
|
||||
$this->bar = 'changed';
|
||||
});
|
||||
|
||||
it('gets executed before each test once again', function () {
|
||||
it('gets executed before each test once again', function (): void {
|
||||
expect($this->bar)->toBe(1);
|
||||
});
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(function (): void {
|
||||
$this->bar++;
|
||||
});
|
||||
|
||||
describe('outer', function () {
|
||||
beforeEach(function () {
|
||||
describe('outer', function (): void {
|
||||
beforeEach(function (): void {
|
||||
$this->bar++;
|
||||
});
|
||||
|
||||
describe('inner', function () {
|
||||
beforeEach(function () {
|
||||
describe('inner', function (): void {
|
||||
beforeEach(function (): void {
|
||||
$this->bar++;
|
||||
});
|
||||
|
||||
it('should call all parent beforeEach functions', function () {
|
||||
it('should call all parent beforeEach functions', function (): void {
|
||||
expect($this->bar)->toBe(3);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('with expectations', function () {
|
||||
describe('with expectations', function (): void {
|
||||
beforeEach()->expect(true)->toBeTrue();
|
||||
|
||||
describe('nested block', function () {
|
||||
test('test', function () {});
|
||||
describe('nested block', function (): void {
|
||||
test('test', function (): void {});
|
||||
});
|
||||
|
||||
test('test', function () {});
|
||||
test('test', function (): void {});
|
||||
});
|
||||
|
||||
describe('matching describe block names', function () {
|
||||
beforeEach(function () {
|
||||
describe('matching describe block names', function (): void {
|
||||
beforeEach(function (): void {
|
||||
$this->foo = 1;
|
||||
});
|
||||
|
||||
describe('outer', function () {
|
||||
beforeEach(function () {
|
||||
describe('outer', function (): void {
|
||||
beforeEach(function (): void {
|
||||
$this->foo++;
|
||||
});
|
||||
|
||||
describe('middle', function () {
|
||||
beforeEach(function () {
|
||||
describe('middle', function (): void {
|
||||
beforeEach(function (): void {
|
||||
$this->foo++;
|
||||
});
|
||||
|
||||
describe('inner', function () {
|
||||
beforeEach(function () {
|
||||
describe('inner', function (): void {
|
||||
beforeEach(function (): void {
|
||||
$this->foo++;
|
||||
});
|
||||
|
||||
it('should call all parent beforeEach functions', function () {
|
||||
it('should call all parent beforeEach functions', function (): void {
|
||||
expect($this->foo)->toBe(4);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('middle', function () {
|
||||
it('should not call beforeEach functions for sibling describe blocks with the same name', function () {
|
||||
describe('middle', function (): void {
|
||||
it('should not call beforeEach functions for sibling describe blocks with the same name', function (): void {
|
||||
expect($this->foo)->toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
describe('inner', function () {
|
||||
it('should not call beforeEach functions for descendent of sibling describe blocks with the same name', function () {
|
||||
describe('inner', function (): void {
|
||||
it('should not call beforeEach functions for descendent of sibling describe blocks with the same name', function (): void {
|
||||
expect($this->foo)->toBe(2);
|
||||
});
|
||||
});
|
||||
@@ -93,36 +93,36 @@ describe('matching describe block names', function () {
|
||||
});
|
||||
|
||||
$matchingNameCalls = 0;
|
||||
describe('matching name', function () use (&$matchingNameCalls) {
|
||||
beforeEach(function () use (&$matchingNameCalls) {
|
||||
describe('matching name', function () use (&$matchingNameCalls): void {
|
||||
beforeEach(function () use (&$matchingNameCalls): void {
|
||||
$matchingNameCalls++;
|
||||
});
|
||||
|
||||
it('should call the before each', function () use (&$matchingNameCalls) {
|
||||
it('should call the before each', function () use (&$matchingNameCalls): void {
|
||||
expect($matchingNameCalls)->toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('matching name', function () use (&$matchingNameCalls) {
|
||||
it('should not call the before each on the describe block with the same name', function () use (&$matchingNameCalls) {
|
||||
describe('matching name', function () use (&$matchingNameCalls): void {
|
||||
it('should not call the before each on the describe block with the same name', function () use (&$matchingNameCalls): void {
|
||||
expect($matchingNameCalls)->toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(function (): void {
|
||||
$this->baz = 1;
|
||||
});
|
||||
|
||||
describe('called on all tests', function () {
|
||||
beforeEach(function () {
|
||||
describe('called on all tests', function (): void {
|
||||
beforeEach(function (): void {
|
||||
$this->baz++;
|
||||
});
|
||||
|
||||
test('beforeEach should be called', function () {
|
||||
test('beforeEach should be called', function (): void {
|
||||
expect($this->baz)->toBe(2);
|
||||
});
|
||||
|
||||
test('beforeEach should be called for all tests', function () {
|
||||
test('beforeEach should be called for all tests', function (): void {
|
||||
expect($this->baz)->toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user