forked from open-telemetry/opentelemetry-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OpenTelemetry\SemConv; | ||
|
||
enum Version: string | ||
{ | ||
case VERSION_1_25_0 = '1.25.0'; | ||
case VERSION_1_24_0 = '1.24.0'; | ||
case VERSION_1_23_1 = '1.23.1'; | ||
case VERSION_1_23_0 = '1.23.0'; | ||
case VERSION_1_22_0 = '1.22.0'; | ||
case VERSION_1_21_0 = '1.21.0'; | ||
|
||
public function url(): string | ||
{ | ||
return 'https://opentelemetry.io/schemas/' . $this->value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Unit\SemConv; | ||
|
||
use OpenTelemetry\SemConv\Version; | ||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
#[CoversClass(Version::class)] | ||
class VersionTest extends TestCase | ||
{ | ||
public function test_url(): void | ||
{ | ||
$url = Version::VERSION_1_25_0->url(); | ||
$this->assertSame('https://opentelemetry.io/schemas/1.25.0', $url); | ||
} | ||
} |