mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| af6240b4ee | |||
| 78b328e970 | |||
| c92fa45ad7 | |||
| d050ef8d54 | |||
| 1c2f1facac | |||
| 8e695d62e9 | |||
| b9a301a13e | |||
| 4b9da9e3c1 | |||
| 239fceab9e | |||
| bedf033655 |
6
.github/workflows/tests.yml
vendored
6
.github/workflows/tests.yml
vendored
@ -8,7 +8,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
php: ['7.3', '7.4', '8.0', '8.1']
|
||||
php: ['7.3', '7.4', '8.0', '8.1', '8.2']
|
||||
dependency-version: [prefer-lowest, prefer-stable]
|
||||
parallel: ['', '--parallel']
|
||||
exclude:
|
||||
@ -16,6 +16,10 @@ jobs:
|
||||
os: macos-latest
|
||||
- php: 8.1
|
||||
os: windows-latest
|
||||
- php: 8.2
|
||||
os: macos-latest
|
||||
- php: 8.2
|
||||
os: windows-latest
|
||||
|
||||
name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} - ${{ matrix.parallel }}
|
||||
|
||||
|
||||
@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [v1.22.1 (2022-08-29)](https://github.com/pestphp/pest/compare/v1.22.0...v1.22.1)
|
||||
### Fixed
|
||||
- Initial PHP 8.2 support ([d050ef8](https://github.com/pestphp/pest/commit/d050ef8d54ffe8dfe015adeb1188aae2cca33c33))
|
||||
|
||||
## [v1.22.0 (2022-08-28)](https://github.com/pestphp/pest/compare/v1.21.3...v1.22.0)
|
||||
### Added
|
||||
- Initial PHP 8.2 support ([#563](https://github.com/pestphp/pest/pull/563))
|
||||
|
||||
## [v1.21.3 (2022-05-12)](https://github.com/pestphp/pest/compare/v1.21.2...v1.21.3)
|
||||
### Fixed
|
||||
- Debug of high order tests ([c1b32b9](https://github.com/pestphp/pest/commit/c1b32b9ffb5134803c490592454b11b8c05ea27d))
|
||||
|
||||
@ -59,8 +59,8 @@
|
||||
"bin/pest"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "php-cs-fixer fix -v",
|
||||
"test:lint": "php-cs-fixer fix -v --dry-run",
|
||||
"lint": "PHP_CS_FIXER_IGNORE_ENV=true php-cs-fixer fix -v",
|
||||
"test:lint": "PHP_CS_FIXER_IGNORE_ENV=true php-cs-fixer fix -v --dry-run",
|
||||
"test:types": "phpstan analyse --ansi --memory-limit=-1",
|
||||
"test:unit": "php bin/pest --colors=always --exclude-group=integration",
|
||||
"test:parallel": "php bin/pest -p --colors=always --exclude-group=integration",
|
||||
|
||||
@ -5,7 +5,9 @@ declare(strict_types=1);
|
||||
namespace Pest\Actions;
|
||||
|
||||
use Pest\Support\Str;
|
||||
|
||||
use function Pest\testDirectory;
|
||||
|
||||
use PHPUnit\Util\FileLoader;
|
||||
use RecursiveDirectoryIterator;
|
||||
use RecursiveIteratorIterator;
|
||||
|
||||
@ -216,6 +216,7 @@ final class TestCaseFactory
|
||||
eval("
|
||||
namespace $namespace;
|
||||
|
||||
#[\AllowDynamicProperties]
|
||||
final class $className extends $baseClass implements $hasPrintableTestCaseClassFQN {
|
||||
$traitsCode
|
||||
|
||||
|
||||
@ -8,7 +8,9 @@ use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Str;
|
||||
use Pest\Exceptions\InvalidConsoleArgument;
|
||||
|
||||
use function Pest\testDirectory;
|
||||
|
||||
use Pest\TestSuite;
|
||||
|
||||
/**
|
||||
|
||||
@ -8,7 +8,9 @@ use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Pest\Console\Thanks;
|
||||
use Pest\Exceptions\InvalidConsoleArgument;
|
||||
|
||||
use function Pest\testDirectory;
|
||||
|
||||
use Pest\TestSuite;
|
||||
|
||||
/**
|
||||
|
||||
@ -8,7 +8,9 @@ use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Pest\Exceptions\InvalidConsoleArgument;
|
||||
use Pest\Support\Str;
|
||||
|
||||
use function Pest\testDirectory;
|
||||
|
||||
use Pest\TestSuite;
|
||||
|
||||
/**
|
||||
|
||||
@ -13,11 +13,14 @@ declare(strict_types=1);
|
||||
namespace Pest\Logging;
|
||||
|
||||
use function class_exists;
|
||||
|
||||
use DOMDocument;
|
||||
use DOMElement;
|
||||
use Exception;
|
||||
|
||||
use function get_class;
|
||||
use function method_exists;
|
||||
|
||||
use Pest\Concerns\Testable;
|
||||
use PHPUnit\Framework\AssertionFailedError;
|
||||
use PHPUnit\Framework\ExceptionWrapper;
|
||||
@ -32,9 +35,12 @@ use PHPUnit\Util\Printer;
|
||||
use PHPUnit\Util\Xml;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
|
||||
use function sprintf;
|
||||
use function str_replace;
|
||||
|
||||
use Throwable;
|
||||
|
||||
use function trim;
|
||||
|
||||
/**
|
||||
|
||||
@ -5,10 +5,13 @@ declare(strict_types=1);
|
||||
namespace Pest\Logging;
|
||||
|
||||
use function getmypid;
|
||||
|
||||
use Pest\Concerns\Logging\WritesToConsole;
|
||||
use Pest\Concerns\Testable;
|
||||
use Pest\Support\ExceptionTrace;
|
||||
|
||||
use function Pest\version;
|
||||
|
||||
use PHPUnit\Framework\AssertionFailedError;
|
||||
use PHPUnit\Framework\Test;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
@ -16,9 +19,11 @@ use PHPUnit\Framework\TestResult;
|
||||
use PHPUnit\Framework\TestSuite;
|
||||
use PHPUnit\Framework\Warning;
|
||||
use PHPUnit\TextUI\DefaultResultPrinter;
|
||||
|
||||
use function round;
|
||||
use function str_replace;
|
||||
use function strlen;
|
||||
|
||||
use Throwable;
|
||||
|
||||
final class TeamCity extends DefaultResultPrinter
|
||||
|
||||
@ -6,7 +6,7 @@ namespace Pest;
|
||||
|
||||
function version(): string
|
||||
{
|
||||
return '1.21.3';
|
||||
return '1.22.1';
|
||||
}
|
||||
|
||||
function testDirectory(string $file = ''): string
|
||||
|
||||
@ -5,7 +5,9 @@ declare(strict_types=1);
|
||||
namespace Pest\Plugins;
|
||||
|
||||
use Pest\Contracts\Plugins\HandlesArguments;
|
||||
|
||||
use function Pest\version;
|
||||
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
|
||||
@ -44,6 +44,7 @@ final class ExceptionTrace
|
||||
*/
|
||||
public static function removePestReferences(Throwable $t): void
|
||||
{
|
||||
/* @phpstan-ignore-next-line */
|
||||
if (!property_exists($t, 'serializableTrace')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -9,9 +9,15 @@ test('an exception is thrown if the the type is not iterable', function () {
|
||||
test('allows for sequences of checks to be run on iterable data', function () {
|
||||
expect([1, 2, 3])
|
||||
->sequence(
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(1); },
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(2); },
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(3); },
|
||||
function ($expectation) {
|
||||
$expectation->toBeInt()->toEqual(1);
|
||||
},
|
||||
function ($expectation) {
|
||||
$expectation->toBeInt()->toEqual(2);
|
||||
},
|
||||
function ($expectation) {
|
||||
$expectation->toBeInt()->toEqual(3);
|
||||
},
|
||||
);
|
||||
|
||||
expect(static::getCount())->toBe(6);
|
||||
@ -20,9 +26,15 @@ test('allows for sequences of checks to be run on iterable data', function () {
|
||||
test('loops back to the start if it runs out of sequence items', function () {
|
||||
expect([1, 2, 3, 1, 2, 3, 1, 2])
|
||||
->sequence(
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(1); },
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(2); },
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(3); },
|
||||
function ($expectation) {
|
||||
$expectation->toBeInt()->toEqual(1);
|
||||
},
|
||||
function ($expectation) {
|
||||
$expectation->toBeInt()->toEqual(2);
|
||||
},
|
||||
function ($expectation) {
|
||||
$expectation->toBeInt()->toEqual(3);
|
||||
},
|
||||
);
|
||||
|
||||
expect(static::getCount())->toBe(16);
|
||||
@ -31,17 +43,29 @@ test('loops back to the start if it runs out of sequence items', function () {
|
||||
test('fails if the number of iterable items is greater than the number of expectations', function () {
|
||||
expect([1, 2])
|
||||
->sequence(
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(1); },
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(2); },
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(3); },
|
||||
function ($expectation) {
|
||||
$expectation->toBeInt()->toEqual(1);
|
||||
},
|
||||
function ($expectation) {
|
||||
$expectation->toBeInt()->toEqual(2);
|
||||
},
|
||||
function ($expectation) {
|
||||
$expectation->toBeInt()->toEqual(3);
|
||||
},
|
||||
);
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('it works with associative arrays', function () {
|
||||
expect(['foo' => 'bar', 'baz' => 'boom'])
|
||||
->sequence(
|
||||
function ($expectation, $key) { $expectation->toEqual('bar'); $key->toEqual('foo'); },
|
||||
function ($expectation, $key) { $expectation->toEqual('boom'); $key->toEqual('baz'); },
|
||||
function ($expectation, $key) {
|
||||
$expectation->toEqual('bar');
|
||||
$key->toEqual('foo');
|
||||
},
|
||||
function ($expectation, $key) {
|
||||
$expectation->toEqual('boom');
|
||||
$key->toEqual('baz');
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@ -54,7 +78,9 @@ test('it can be passed non-callable values', function () {
|
||||
test('it can be passed a mixture of value types', function () {
|
||||
expect(['foo', 'bar', 'baz'])->sequence(
|
||||
'foo',
|
||||
function ($expectation) { $expectation->toEqual('bar')->toBeString(); },
|
||||
function ($expectation) {
|
||||
$expectation->toEqual('bar')->toBeString();
|
||||
},
|
||||
'baz'
|
||||
);
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Tests\CustomTestCase;
|
||||
|
||||
use function PHPUnit\Framework\assertTrue;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CustomTestCase extends TestCase
|
||||
|
||||
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Tests\CustomTestCase;
|
||||
|
||||
use function PHPUnit\Framework\assertTrue;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ExecutedTest extends TestCase
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Pest\Plugins\Version;
|
||||
|
||||
use function Pest\version;
|
||||
|
||||
use Symfony\Component\Console\Output\BufferedOutput;
|
||||
|
||||
it('outputs the version when --version is used', function () {
|
||||
|
||||
Reference in New Issue
Block a user