Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit ebea9ce

Browse files
author
billpyang
committed
fix:完善单元测试
1 parent 9422fb3 commit ebea9ce

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/Watchers/QueueWatcherTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Mockery;
1212
use OpenTelemetry\SemConv\TraceAttributes;
1313
use Overtrue\LaravelOpenTelemetry\Facades\Measure;
14+
use Overtrue\LaravelOpenTelemetry\Support\MeasureDataFlusher;
1415
use Overtrue\LaravelOpenTelemetry\Tests\TestCase;
1516
use Overtrue\LaravelOpenTelemetry\Watchers\QueueWatcher;
1617

@@ -118,6 +119,9 @@ public function test_records_job_processed_event()
118119
'messaging.job.status' => 'completed',
119120
]);
120121

122+
$flusher = Mockery::mock('alias:'.MeasureDataFlusher::class);
123+
$flusher->shouldReceive('flush')->once();
124+
121125
$this->watcher->recordJobProcessed($event);
122126
}
123127

@@ -138,6 +142,9 @@ public function test_records_job_failed_event()
138142
'messaging.job.status' => 'failed',
139143
]);
140144

145+
$flusher = Mockery::mock('alias:'.MeasureDataFlusher::class);
146+
$flusher->shouldReceive('flush')->once();
147+
141148
$this->watcher->recordJobFailed($event);
142149
}
143150

0 commit comments

Comments
 (0)