File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
src/Instrumentation/Laravel/tests/Integration/Database/Eloquent Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -84,12 +84,13 @@ public function test_find(): void
8484
8585 // spans contains 2 eloquent spans for 'find' and 'get', because it method internally calls 'getModels' method.
8686 // So, filtering span only find span.
87- $ spans = array_filter (
88- $ this ->filterOnlyEloquentSpans (),
89- fn ($ span ) => $ span ->getAttributes ()->get ('laravel.eloquent.operation ' ) === 'find '
87+ $ spans = array_values (
88+ array_filter (
89+ $ this ->filterOnlyEloquentSpans (),
90+ fn ($ span ) => $ span ->getAttributes ()->get ('laravel.eloquent.operation ' ) === 'find '
91+ )
9092 );
9193
92-
9394 $ this ->assertCount (1 , $ spans );
9495
9596 $ span = $ spans [0 ];
@@ -152,13 +153,13 @@ public function test_destory(): void
152153 {
153154 TestModel::destroy ([1 ]);
154155
155- $ spans = $ this ->filterOnlyEloquentSpans ();
156-
157156 // spans contains 2 eloquent spans for 'destroy' and 'get', because it method internally calls 'getModels' method.
158157 // So, filtering span only 'destroy' span.
159- $ spans = array_filter (
160- $ this ->filterOnlyEloquentSpans (),
161- fn ($ span ) => $ span ->getAttributes ()->get ('laravel.eloquent.operation ' ) === 'destroy '
158+ $ spans = array_values (
159+ array_filter (
160+ $ this ->filterOnlyEloquentSpans (),
161+ fn ($ span ) => $ span ->getAttributes ()->get ('laravel.eloquent.operation ' ) === 'destroy '
162+ )
162163 );
163164
164165 $ this ->assertCount (1 , $ spans );
You can’t perform that action at this time.
0 commit comments