Skip to content

Commit 639f767

Browse files
committed
format and replace class path
1 parent 3e91955 commit 639f767

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/Instrumentation/Laravel/tests/Integration/Database/ModelTest.php renamed to src/Instrumentation/Laravel/tests/Integration/Database/Eloquent/ModelTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace OpenTelemetry\Tests\Contrib\Instrumentation\Laravel;
46

5-
use OpenTelemetry\Tests\Contrib\Instrumentation\Laravel\Integration\TestCase;
67
use Illuminate\Support\Facades\DB;
78
use OpenTelemetry\Tests\Contrib\Instrumentation\Laravel\Fixtures\Models\TestModel;
9+
use OpenTelemetry\Tests\Contrib\Instrumentation\Laravel\Integration\TestCase;
810

911
/**
1012
* Integration test for Eloquent\Model hooks
@@ -54,7 +56,7 @@ private function filterOnlyEloquentSpans(): array
5456
return array_values(
5557
array_filter(
5658
iterator_to_array($this->storage),
57-
fn ($span) =>
59+
fn ($span) =>
5860
$span instanceof \OpenTelemetry\SDK\Trace\ImmutableSpan &&
5961
$span->getAttributes()->has('laravel.eloquent.operation')
6062
)
@@ -83,11 +85,11 @@ public function test_find_and_get_models(): void
8385
$spans = $this->filterOnlyEloquentSpans();
8486

8587
// spans contains 2 eloquent spans for 'find' and 'get', because it method internally calls 'getModels' method.
86-
$this->assertCount(2, $spans);
88+
$this->assertCount(2, $spans);
8789

8890
foreach ($spans as $span) {
8991
$this->assertSame(
90-
'OpenTelemetry\Tests\Contrib\Instrumentation\Laravel\Fixtures\Models\TestModel',
92+
'OpenTelemetry\Tests\Contrib\Instrumentation\Laravel\Fixtures\Models\TestModel',
9193
$span->getAttributes()->get('laravel.eloquent.model')
9294
);
9395
$this->assertSame('test_models', $span->getAttributes()->get('laravel.eloquent.table'));
@@ -162,7 +164,7 @@ public function test_destory(): void
162164

163165
foreach ($spans as $span) {
164166
$this->assertSame(
165-
'OpenTelemetry\Tests\Contrib\Instrumentation\Laravel\Fixtures\Models\TestModel',
167+
'OpenTelemetry\Tests\Contrib\Instrumentation\Laravel\Fixtures\Models\TestModel',
166168
$span->getAttributes()->get('laravel.eloquent.model')
167169
);
168170
$this->assertSame('test_models', $span->getAttributes()->get('laravel.eloquent.table'));
@@ -192,4 +194,4 @@ public function test_refresh(): void
192194
$this->assertSame('test_models', $span->getAttributes()->get('laravel.eloquent.table'));
193195
$this->assertSame('refresh', $span->getAttributes()->get('laravel.eloquent.operation'));
194196
}
195-
}
197+
}

src/Instrumentation/Laravel/tests/Integration/LaravelInstrumentationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Illuminate\Support\Facades\Http;
1010
use Illuminate\Support\Facades\Log;
1111
use OpenTelemetry\SemConv\TraceAttributes;
12-
use OpenTelemetry\Tests\Contrib\Instrumentation\Laravel\Fixtures\Models\TestModel;
1312

1413
/** @psalm-suppress UnusedClass */
1514
class LaravelInstrumentationTest extends TestCase

0 commit comments

Comments
 (0)