mirror of
https://github.com/pestphp/pest.git
synced 2026-03-05 23:37:22 +01:00
refactor: logger
This commit is contained in:
@ -308,7 +308,6 @@ final class JunitXmlLogger
|
||||
new TestFinishedSubscriber($this),
|
||||
new TestErroredSubscriber($this),
|
||||
new TestFailedSubscriber($this),
|
||||
new TestMarkedIncompleteSubscriber($this),
|
||||
new TestSkippedSubscriber($this),
|
||||
new TestRunnerExecutionFinishedSubscriber($this),
|
||||
);
|
||||
|
||||
@ -292,10 +292,8 @@ final class OppositeExpectation
|
||||
|
||||
/**
|
||||
* Not supported.
|
||||
*
|
||||
* @param array<int, class-string>|string $interfaces
|
||||
*/
|
||||
public function toOnlyImplement(array|string $interfaces): never
|
||||
public function toOnlyImplement(): never
|
||||
{
|
||||
throw InvalidExpectation::fromMethods(['not', 'toOnlyImplement']);
|
||||
}
|
||||
@ -328,10 +326,8 @@ final class OppositeExpectation
|
||||
|
||||
/**
|
||||
* Not supported.
|
||||
*
|
||||
* @param array<int, string>|string $targets
|
||||
*/
|
||||
public function toOnlyUse(array|string $targets): never
|
||||
public function toOnlyUse(): never
|
||||
{
|
||||
throw InvalidExpectation::fromMethods(['not', 'toOnlyUse']);
|
||||
}
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pest\Logging\TeamCity\Subscriber;
|
||||
|
||||
use PHPUnit\Event\Test\MarkedIncomplete;
|
||||
use PHPUnit\Event\Test\MarkedIncompleteSubscriber;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber
|
||||
{
|
||||
public function notify(MarkedIncomplete $event): void
|
||||
{
|
||||
$this->logger()->testMarkedIncomplete($event);
|
||||
}
|
||||
}
|
||||
@ -12,7 +12,6 @@ use Pest\Logging\TeamCity\Subscriber\TestErroredSubscriber;
|
||||
use Pest\Logging\TeamCity\Subscriber\TestExecutionFinishedSubscriber;
|
||||
use Pest\Logging\TeamCity\Subscriber\TestFailedSubscriber;
|
||||
use Pest\Logging\TeamCity\Subscriber\TestFinishedSubscriber;
|
||||
use Pest\Logging\TeamCity\Subscriber\TestMarkedIncompleteSubscriber;
|
||||
use Pest\Logging\TeamCity\Subscriber\TestPreparedSubscriber;
|
||||
use Pest\Logging\TeamCity\Subscriber\TestSkippedSubscriber;
|
||||
use Pest\Logging\TeamCity\Subscriber\TestSuiteFinishedSubscriber;
|
||||
@ -28,7 +27,6 @@ use PHPUnit\Event\Test\ConsideredRisky;
|
||||
use PHPUnit\Event\Test\Errored;
|
||||
use PHPUnit\Event\Test\Failed;
|
||||
use PHPUnit\Event\Test\Finished;
|
||||
use PHPUnit\Event\Test\MarkedIncomplete;
|
||||
use PHPUnit\Event\Test\Prepared;
|
||||
use PHPUnit\Event\Test\Skipped;
|
||||
use PHPUnit\Event\TestRunner\ExecutionFinished;
|
||||
@ -108,7 +106,7 @@ final class TeamCityLogger
|
||||
$this->time = $event->telemetryInfo()->time();
|
||||
}
|
||||
|
||||
public function testMarkedIncomplete(MarkedIncomplete $event): never
|
||||
public function testMarkedIncomplete(): never
|
||||
{
|
||||
throw ShouldNotHappen::fromMessage('testMarkedIncomplete not implemented.');
|
||||
}
|
||||
@ -262,7 +260,6 @@ final class TeamCityLogger
|
||||
new TestFinishedSubscriber($this),
|
||||
new TestErroredSubscriber($this),
|
||||
new TestFailedSubscriber($this),
|
||||
new TestMarkedIncompleteSubscriber($this),
|
||||
new TestSkippedSubscriber($this),
|
||||
new TestConsideredRiskySubscriber($this),
|
||||
new TestExecutionFinishedSubscriber($this),
|
||||
|
||||
@ -64,8 +64,6 @@ final class Exporter
|
||||
continue;
|
||||
}
|
||||
|
||||
assert(is_array($data));
|
||||
|
||||
$result[] = $context->contains($data[$key]) !== false
|
||||
? '*RECURSION*'
|
||||
: sprintf('[%s]', $this->shortenedRecursiveExport($data[$key], $context));
|
||||
|
||||
@ -14,7 +14,7 @@ afterEach(function () {
|
||||
'__pest_evaluable__something_2__→_it_can_run_after_test' => expect($this->count)->toBe(1),
|
||||
'__pest_evaluable_high_order_test' => expect($this->count)->toBe(1),
|
||||
'__pest_evaluable_high_order_test_with_skip' => expect($this->count)->toBe(0),
|
||||
'__pest_evaluable_post__foo__→_defer_Closure_→_expect_Closure_→_toBe_1' => expect($this->count)->toBe(1),
|
||||
'__pest_evaluable_post__foo__→_defer_Closure_Object____→_expect_Closure_Object____→_toBe_1' => expect($this->count)->toBe(1),
|
||||
default => $this->fail('Unexpected test name: '.$this->name()),
|
||||
};
|
||||
|
||||
@ -61,7 +61,7 @@ afterEach(function () {
|
||||
'__pest_evaluable__something_2__→_it_can_run_after_test' => expect($this->count)->toBe(2),
|
||||
'__pest_evaluable_high_order_test' => expect($this->count)->toBe(2),
|
||||
'__pest_evaluable_high_order_test_with_skip' => expect($this->count)->toBe(1),
|
||||
'__pest_evaluable_post__foo__→_defer_Closure_→_expect_Closure_→_toBe_1' => expect($this->count)->toBe(2),
|
||||
'__pest_evaluable_post__foo__→_defer_Closure_Object____→_expect_Closure_Object____→_toBe_1' => expect($this->count)->toBe(2),
|
||||
|
||||
default => $this->fail('Unexpected test name: '.$this->name()),
|
||||
|
||||
@ -80,7 +80,7 @@ afterEach(function () {
|
||||
'__pest_evaluable__something_2__→_it_can_run_after_test' => expect($this->count)->toBe(3),
|
||||
'__pest_evaluable_high_order_test' => expect($this->count)->toBe(3),
|
||||
'__pest_evaluable_high_order_test_with_skip' => expect($this->count)->toBe(2),
|
||||
'__pest_evaluable_post__foo__→_defer_Closure_→_expect_Closure_→_toBe_1' => expect($this->count)->toBe(3),
|
||||
'__pest_evaluable_post__foo__→_defer_Closure_Object____→_expect_Closure_Object____→_toBe_1' => expect($this->count)->toBe(3),
|
||||
default => $this->fail('Unexpected test name: '.$this->name()),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user