fix: package lock fingerprint

This commit is contained in:
nuno maduro
2026-07-18 01:10:01 +01:00
parent 9e79e491e2
commit 820fa08313
237 changed files with 2409 additions and 2100 deletions
+23 -21
View File
@@ -1,49 +1,51 @@
<?php
declare(strict_types=1);
use Pest\Support\Arr;
describe('last', function () {
it('should return false for an empty arary', function () {
describe('last', function (): void {
it('should return false for an empty arary', function (): void {
expect(Arr::last([]))->toBeFalse();
});
it('should return the last element for an array with a single element', function () {
it('should return the last element for an array with a single element', function (): void {
expect(Arr::last([1]))->toBe(1);
});
it('should return the last element for an array without changing the internal pointer', function () {
it('should return the last element for an array without changing the internal pointer', function (): void {
$array = [1, 2, 3];
expect(Arr::last($array))->toBe(3);
expect(current($array))->toBe(1);
expect(Arr::last($array))->toBe(3)
->and(current($array))->toBe(1);
next($array);
expect(current($array))->toBe(2);
expect(Arr::last($array))->toBe(3);
expect(current($array))->toBe(2);
expect(current($array))->toBe(2)
->and(Arr::last($array))->toBe(3)
->and(current($array))->toBe(2);
});
it('should return the last element for an associative array without changing the internal pointer', function () {
it('should return the last element for an associative array without changing the internal pointer', function (): void {
$array = ['first' => 1, 'second' => 2, 'third' => 3];
expect(Arr::last($array))->toBe(3);
expect(current($array))->toBe(1);
expect(Arr::last($array))->toBe(3)
->and(current($array))->toBe(1);
next($array);
expect(current($array))->toBe(2);
expect(Arr::last($array))->toBe(3);
expect(current($array))->toBe(2);
expect(current($array))->toBe(2)
->and(Arr::last($array))->toBe(3)
->and(current($array))->toBe(2);
});
it('should return the last element for an mixed key array without changing the internal pointer', function () {
it('should return the last element for an mixed key array without changing the internal pointer', function (): void {
$array = ['first' => 1, 2, 'third' => 3];
expect(Arr::last($array))->toBe(3);
expect(current($array))->toBe(1);
expect(Arr::last($array))->toBe(3)
->and(current($array))->toBe(1);
next($array);
expect(current($array))->toBe(2);
expect(Arr::last($array))->toBe(3);
expect(current($array))->toBe(2);
expect(current($array))->toBe(2)
->and(Arr::last($array))->toBe(3)
->and(current($array))->toBe(2);
});
});