Skip to content

Commit

Permalink
use common enums
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmastech committed Jul 21, 2024
1 parent 4ebc1ff commit 5984508
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 32 deletions.
14 changes: 7 additions & 7 deletions tests/TagNormalizers/ConvertEnumNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Cosmastech\StatsDClientAdapter\Tests\TagNormalizers;

use Cosmastech\StatsDClientAdapter\TagNormalizers\ConvertEnumNormalizer;
use Cosmastech\StatsDClientAdapter\Tests\TagNormalizers\Enums\IntBackedEnum;
use Cosmastech\StatsDClientAdapter\Tests\TagNormalizers\Enums\StringBackedEnum;
use Cosmastech\StatsDClientAdapter\Tests\TagNormalizers\Enums\UnbackedEnum;
use Cosmastech\StatsDClientAdapter\Tests\Enums\IntBackedEnum;
use Cosmastech\StatsDClientAdapter\Tests\Enums\PlainUnitEnum;
use Cosmastech\StatsDClientAdapter\Tests\Enums\StringBackedEnum;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
Expand All @@ -21,17 +21,17 @@ public function normalize_convertsBackedEnumInValue(): void

// And
$arr = [
"key-1" => StringBackedEnum::VALUE_1,
"key-2" => IntBackedEnum::VALUE_IS_22,
"key-3" => UnbackedEnum::NO_BACKING,
"key-1" => StringBackedEnum::A,
"key-2" => IntBackedEnum::TWO,
"key-3" => PlainUnitEnum::SECOND,
];

// When
$actual = $convertEnumNormalizer->normalize($arr);

// Then
self::assertEqualsCanonicalizing(
['key-1' => "my-first-value", "key-2" => 22, "key-3" => "NO_BACKING"],
['key-1' => 'a', 'key-2' => 2, 'key-3' => 'SECOND'],
$actual
);
}
Expand Down
8 changes: 0 additions & 8 deletions tests/TagNormalizers/Enums/IntBackedEnum.php

This file was deleted.

9 changes: 0 additions & 9 deletions tests/TagNormalizers/Enums/StringBackedEnum.php

This file was deleted.

8 changes: 0 additions & 8 deletions tests/TagNormalizers/Enums/UnbackedEnum.php

This file was deleted.

0 comments on commit 5984508

Please sign in to comment.