Skip to content

Commit d9fb12a

Browse files
Delete unused code
1 parent dce0d1b commit d9fb12a

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

src/Logging/TestDox/TestResult/TestResult.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use PHPUnit\Event\Code\TestMethod;
1313
use PHPUnit\Event\Code\Throwable;
14-
use PHPUnit\Event\Telemetry\Duration;
1514
use PHPUnit\Framework\TestStatus\TestStatus;
1615

1716
/**
@@ -22,14 +21,12 @@
2221
final class TestResult
2322
{
2423
private readonly TestMethod $test;
25-
private readonly Duration $duration;
2624
private readonly TestStatus $status;
2725
private readonly ?Throwable $throwable;
2826

29-
public function __construct(TestMethod $test, Duration $duration, TestStatus $status, ?Throwable $throwable)
27+
public function __construct(TestMethod $test, TestStatus $status, ?Throwable $throwable)
3028
{
3129
$this->test = $test;
32-
$this->duration = $duration;
3330
$this->status = $status;
3431
$this->throwable = $throwable;
3532
}
@@ -39,11 +36,6 @@ public function test(): TestMethod
3936
return $this->test;
4037
}
4138

42-
public function duration(): Duration
43-
{
44-
return $this->duration;
45-
}
46-
4739
public function status(): TestStatus
4840
{
4941
return $this->status;

src/Logging/TestDox/TestResult/TestResultCollector.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use PHPUnit\Event\EventFacadeIsSealedException;
2222
use PHPUnit\Event\Facade;
2323
use PHPUnit\Event\InvalidArgumentException;
24-
use PHPUnit\Event\Telemetry\HRTime;
2524
use PHPUnit\Event\Test\ConsideredRisky;
2625
use PHPUnit\Event\Test\Errored;
2726
use PHPUnit\Event\Test\Failed;
@@ -44,7 +43,6 @@ final class TestResultCollector
4443
* @psalm-var array<string, list<TestDoxTestMethod>>
4544
*/
4645
private array $tests = [];
47-
private ?HRTime $time = null;
4846
private ?TestStatus $status = null;
4947
private ?Throwable $throwable = null;
5048

@@ -127,7 +125,6 @@ public function testPrepared(Prepared $event): void
127125
return;
128126
}
129127

130-
$this->time = $event->telemetryInfo()->time();
131128
$this->status = TestStatus::unknown();
132129
$this->throwable = null;
133130
}
@@ -196,12 +193,10 @@ public function testFinished(Finished $event): void
196193

197194
$this->tests[$test->testDox()->prettifiedClassName()][] = new TestDoxTestMethod(
198195
$test,
199-
$event->telemetryInfo()->time()->duration($this->time),
200196
$this->status,
201197
$this->throwable,
202198
);
203199

204-
$this->time = null;
205200
$this->status = null;
206201
$this->throwable = null;
207202
}

0 commit comments

Comments
 (0)