mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 705f19dd87 | |||
| 5637dfa75d | |||
| cf5275293f | |||
| 81efe5953b | |||
| a37a3b9f99 | |||
| 9100913184 | |||
| 8fdb0b3d32 |
34
CHANGELOG.md
34
CHANGELOG.md
@ -2,9 +2,41 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
## [v2.9.4 (2023-07-22)](https://github.com/pestphp/pest/compare/v2.9.3...v2.9.4)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Output on `describe` `beforeEach` failure ([5637dfa](https://github.com/pestphp/pest/commit/5637dfa75d1a331adc810935536cde7c3196af06))
|
||||
|
||||
## [v2.9.3 (2023-07-20)](https://github.com/pestphp/pest/compare/v2.9.2...v2.9.3)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Snapshots directory on Windows environments ([cf52752](https://github.com/pestphp/pest/commit/cf5275293fe693ec2cf4dbadbadae01daaa08169))
|
||||
|
||||
## [v2.9.2 (2023-07-20)](https://github.com/pestphp/pest/compare/v2.9.1...v2.9.2)
|
||||
|
||||
### Fixed
|
||||
|
||||
- `beforeEach` on Windows environments ([a37a3b9](https://github.com/pestphp/pest/commit/a37a3b9f9931bc1ab1ea9e1d6d38dfb55dde3f74))
|
||||
|
||||
## [v2.9.1 (2023-07-20)](https://github.com/pestphp/pest/compare/v2.9.0...v2.9.1)
|
||||
|
||||
### Chore
|
||||
|
||||
- Bumps PHPUnit to `^10.2.6` ([8fdb0b3](https://github.com/pestphp/pest/commit/8fdb0b3d32ce9ee12bd182f22751c2b41a53e97b))
|
||||
|
||||
## [v2.9.0 (2023-07-19)](https://github.com/pestphp/pest/compare/v2.8.1...v2.9.0)
|
||||
|
||||
TODO
|
||||
> "Spicy Summer" is the codename assigned to Pest 2.9, for full details check our announcement: [https://pestphp.com/docs/pest-spicy-summer-release](https://pestphp.com/docs/pest-spicy-summer-release)
|
||||
|
||||
### Added
|
||||
|
||||
- Built-in Snapshot Testing ([c828756](https://github.com/pestphp/pest/commit/c8287567eb8c3dbea5845b2a6f70804b094b4b60))
|
||||
- Describe Blocks ([c828756](https://github.com/pestphp/pest/commit/c8287567eb8c3dbea5845b2a6f70804b094b4b60))
|
||||
- Architectural Testing++ ([c828756](https://github.com/pestphp/pest/commit/c8287567eb8c3dbea5845b2a6f70804b094b4b60))
|
||||
- Type Coverage Plugin ([c828756](https://github.com/pestphp/pest/commit/c8287567eb8c3dbea5845b2a6f70804b094b4b60))
|
||||
- Drift Plugin ([c828756](https://github.com/pestphp/pest/commit/c8287567eb8c3dbea5845b2a6f70804b094b4b60))
|
||||
|
||||
## [v2.8.1 (2023-06-20)](https://github.com/pestphp/pest/compare/v2.8.0...v2.8.1)
|
||||
|
||||
|
||||
@ -18,16 +18,16 @@
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.1.0",
|
||||
"brianium/paratest": "^7.2.2",
|
||||
"brianium/paratest": "^7.2.3",
|
||||
"nunomaduro/collision": "^7.7.0",
|
||||
"nunomaduro/termwind": "^1.15.1",
|
||||
"pestphp/pest-plugin": "^2.0.1",
|
||||
"pestphp/pest-plugin-arch": "^2.2.2",
|
||||
"phpunit/phpunit": "^10.2.3"
|
||||
"phpunit/phpunit": "^10.2.6"
|
||||
},
|
||||
"conflict": {
|
||||
"webmozart/assert": "<1.11.0",
|
||||
"phpunit/phpunit": ">10.2.3"
|
||||
"phpunit/phpunit": ">10.2.6"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@ -185,6 +185,10 @@ trait Testable
|
||||
{
|
||||
TestSuite::getInstance()->test = $this;
|
||||
|
||||
$method = TestSuite::getInstance()->tests->get(self::$__filename)->getMethod($this->name());
|
||||
|
||||
$this->__description = self::$__latestDescription = $this->dataName() ? $method->description.' with '.$this->dataName() : $method->description;
|
||||
|
||||
parent::setUp();
|
||||
|
||||
$beforeEach = TestSuite::getInstance()->beforeEach->get(self::$__filename)[1];
|
||||
@ -234,10 +238,6 @@ trait Testable
|
||||
*/
|
||||
private function __resolveTestArguments(array $arguments): array
|
||||
{
|
||||
$method = TestSuite::getInstance()->tests->get(self::$__filename)->getMethod($this->name());
|
||||
|
||||
$this->__description = self::$__latestDescription = $this->dataName() ? $method->description.' with '.$this->dataName() : $method->description;
|
||||
|
||||
$underlyingTest = Reflection::getFunctionVariable($this->__test, 'closure');
|
||||
$testParameterTypes = array_values(Reflection::getFunctionArguments($underlyingTest));
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ namespace Pest;
|
||||
|
||||
function version(): string
|
||||
{
|
||||
return '2.9.0';
|
||||
return '2.9.4';
|
||||
}
|
||||
|
||||
function testDirectory(string $file = ''): string
|
||||
|
||||
@ -115,7 +115,7 @@ final class Backtrace
|
||||
continue;
|
||||
}
|
||||
|
||||
if (str_contains($trace['file'], 'pest/src')) {
|
||||
if (str_contains($trace['file'], 'pest'.DIRECTORY_SEPARATOR.'src')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -76,8 +76,10 @@ final class TestSuite
|
||||
$this->afterEach = new AfterEachRepository();
|
||||
$this->afterAll = new AfterAllRepository();
|
||||
$this->rootPath = (string) realpath($rootPath);
|
||||
|
||||
$this->snapshots = new SnapshotRepository($this->rootPath.'/'.$this->testPath, '.pest/snapshots');
|
||||
$this->snapshots = new SnapshotRepository(
|
||||
implode(DIRECTORY_SEPARATOR, [$this->rootPath, $this->testPath]),
|
||||
implode(DIRECTORY_SEPARATOR, ['.pest', 'snapshots']),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
Pest Testing Framework 2.9.0.
|
||||
Pest Testing Framework 2.9.4.
|
||||
|
||||
USAGE: pest <file> [options]
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
|
||||
Pest Testing Framework 2.9.0.
|
||||
Pest Testing Framework 2.9.4.
|
||||
|
||||
|
||||
@ -1052,6 +1052,7 @@
|
||||
✓ it can return an array of all test suite filenames
|
||||
|
||||
PASS Tests\Visual\BeforeEachTestName
|
||||
✓ description
|
||||
✓ latest description
|
||||
|
||||
PASS Tests\Visual\Collision
|
||||
@ -1084,4 +1085,4 @@
|
||||
WARN Tests\Visual\Version
|
||||
- visual snapshot of help command output
|
||||
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 742 passed (1787 assertions)
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 743 passed (1788 assertions)
|
||||
@ -1,6 +1,13 @@
|
||||
<?php
|
||||
|
||||
beforeEach(fn () => $this->latestDescription = self::$__latestDescription);
|
||||
beforeEach(function () {
|
||||
$this->description = $this->__description;
|
||||
$this->latestDescription = self::$__latestDescription;
|
||||
});
|
||||
|
||||
test('description', function () {
|
||||
expect($this->description)->toBe('description');
|
||||
});
|
||||
|
||||
test('latest description', function () {
|
||||
expect($this->latestDescription)->toBe('latest description');
|
||||
|
||||
Reference in New Issue
Block a user