Integrate pest-plugins with 2 interfaces

integrate pest-plugin package and remove core coverage stuff
This commit is contained in:
johannes.pichler
2020-05-29 11:22:45 +02:00
parent 88d2391d2e
commit b093e8ee29
9 changed files with 71 additions and 333 deletions

View File

@ -98,10 +98,6 @@
PASS Tests\Plugins\Traits
✓ it allows global uses
PASS Tests\Unit\Actions\AddsCoverage
✓ it adds coverage if --coverage exist
✓ it adds coverage if --min exist
PASS Tests\Unit\Actions\AddsDefaults
✓ it sets defaults
✓ it does not override options
@ -115,9 +111,6 @@
✓ it throws exception when `process isolation` is true
✓ it do not throws exception when `process isolation` is false
PASS Tests\Unit\Console\Coverage
✓ it generates coverage based on file input
PASS Tests\Unit\Support\Backtrace
✓ it gets file name from called file
@ -135,5 +128,5 @@
WARN Tests\Visual\Success
s visual snapshot of test suite on success
Tests: 6 skipped, 70 passed
Time: 2.68s
Tests: 6 skipped, 67 passed
Time: 2.67s

View File

@ -1,32 +0,0 @@
<?php
use Pest\Actions\AddsCoverage;
use Pest\TestSuite;
it('adds coverage if --coverage exist', function () {
$testSuite = new TestSuite(getcwd());
assertFalse($testSuite->coverage);
$arguments = AddsCoverage::from($testSuite, []);
assertEquals([], $arguments);
assertFalse($testSuite->coverage);
$arguments = AddsCoverage::from($testSuite, ['--coverage']);
assertEquals(['--coverage-php', \Pest\Console\Coverage::getPath()], $arguments);
assertTrue($testSuite->coverage);
});
it('adds coverage if --min exist', function () {
$testSuite = new TestSuite(getcwd());
assertEquals($testSuite->coverageMin, 0.0);
assertFalse($testSuite->coverage);
AddsCoverage::from($testSuite, []);
assertEquals($testSuite->coverageMin, 0.0);
AddsCoverage::from($testSuite, ['--min=2']);
assertEquals($testSuite->coverageMin, 2.0);
AddsCoverage::from($testSuite, ['--min=2.4']);
assertEquals($testSuite->coverageMin, 2.4);
});

View File

@ -1,24 +0,0 @@
<?php
use Pest\Console\Coverage;
it('generates coverage based on file input', function () {
assertEquals([
'4..6', '102',
], Coverage::getMissingCoverage(new class() {
public function getCoverageData(): array
{
return [
1 => ['foo'],
2 => ['bar'],
4 => [],
5 => [],
6 => [],
7 => null,
100 => null,
101 => ['foo'],
102 => [],
];
}
}));
});