mirror of
https://github.com/pestphp/pest.git
synced 2026-03-10 01:37:21 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 283d8f3e03 | |||
| 1c3e820283 | |||
| accd4eb7b4 | |||
| ae7991c7e9 | |||
| e9e72d607e | |||
| 40766f9275 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ coverage.xml
|
|||||||
.temp/coverage.php
|
.temp/coverage.php
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
.vscode/
|
||||||
@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [v0.2.1 (2020-06-17)](https://github.com/pestphp/pest/compare/v0.2.0...v0.2.1)
|
||||||
|
### Fixes
|
||||||
|
- Multiple `uses` in the same path override previous `uses` ([#97](https://github.com/pestphp/pest/pull/97))
|
||||||
|
|
||||||
## [v0.2.0 (2020-06-14)](https://github.com/pestphp/pest/compare/v0.1.5...v0.2.0)
|
## [v0.2.0 (2020-06-14)](https://github.com/pestphp/pest/compare/v0.1.5...v0.2.0)
|
||||||
### Adds
|
### Adds
|
||||||
- `--init` option to install Pest on a new blank project ([70b3c7e](https://github.com/pestphp/pest/commit/70b3c7ea1ddb031f3bbfaabdc28d56270608ebbd))
|
- `--init` option to install Pest on a new blank project ([70b3c7e](https://github.com/pestphp/pest/commit/70b3c7ea1ddb031f3bbfaabdc28d56270608ebbd))
|
||||||
|
|||||||
@ -104,7 +104,14 @@ final class TestRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($paths as $path) {
|
foreach ($paths as $path) {
|
||||||
$this->uses[$path] = [$classOrTraits, $groups];
|
if (array_key_exists($path, $this->uses)) {
|
||||||
|
$this->uses[$path] = [
|
||||||
|
array_merge($this->uses[$path][0], $classOrTraits),
|
||||||
|
array_merge($this->uses[$path][1], $groups),
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$this->uses[$path] = [$classOrTraits, $groups];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -101,6 +101,7 @@
|
|||||||
|
|
||||||
PASS Tests\Plugins\Traits
|
PASS Tests\Plugins\Traits
|
||||||
✓ it allows global uses
|
✓ it allows global uses
|
||||||
|
✓ it allows multiple global uses registered in the same path
|
||||||
|
|
||||||
PASS Tests\Unit\Actions\AddsDefaults
|
PASS Tests\Unit\Actions\AddsDefaults
|
||||||
✓ it sets defaults
|
✓ it sets defaults
|
||||||
@ -143,5 +144,5 @@
|
|||||||
WARN Tests\Visual\Success
|
WARN Tests\Visual\Success
|
||||||
s visual snapshot of test suite on success
|
s visual snapshot of test suite on success
|
||||||
|
|
||||||
Tests: 6 skipped, 78 passed
|
Tests: 6 skipped, 79 passed
|
||||||
Time: 3.09s
|
Time: 3.44s
|
||||||
|
|||||||
@ -12,4 +12,13 @@ trait PluginTrait
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trait SecondPluginTrait
|
||||||
|
{
|
||||||
|
public function assertSecondPluginTraitGotRegistered(): void
|
||||||
|
{
|
||||||
|
assertTrue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Pest\Plugin::uses(PluginTrait::class);
|
Pest\Plugin::uses(PluginTrait::class);
|
||||||
|
Pest\Plugin::uses(SecondPluginTrait::class);
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
it('allows global uses')->assertPluginTraitGotRegistered();
|
it('allows global uses')->assertPluginTraitGotRegistered();
|
||||||
|
|
||||||
|
it('allows multiple global uses registered in the same path')->assertSecondPluginTraitGotRegistered();
|
||||||
|
|||||||
Reference in New Issue
Block a user