88use Sentry \Attributes \Attribute ;
99
1010/**
11+ * @phpstan-import-type AttributeType from Attribute
1112 * @phpstan-import-type AttributeValue from Attribute
12- * @phpstan-import-type AttributeSerialized from Attribute
1313 */
1414final class AttributeTest extends TestCase
1515{
1616 /**
17- * @param AttributeValue $value
18- * @param AttributeSerialized |null $expected
17+ * @param AttributeValue $value
18+ * @param array{type: AttributeType, value: AttributeValue} |null $expected
1919 *
2020 * @dataProvider fromValueDataProvider
2121 */
22- public function testFromValue ($ value , $ expected ): void
22+ public function testFromValue ($ value , ? array $ expected ): void
2323 {
2424 $ attribute = Attribute::tryFromValue ($ value );
2525
@@ -29,7 +29,6 @@ public function testFromValue($value, $expected): void
2929 return ;
3030 }
3131
32- $ this ->assertEquals ($ expected , $ attribute ->toArray ());
3332 $ this ->assertEquals ($ expected ['type ' ], $ attribute ->getType ());
3433 $ this ->assertEquals ($ expected ['value ' ], $ attribute ->getValue ());
3534 }
@@ -97,35 +96,6 @@ public function __toString(): string
9796 ];
9897 }
9998
100- public function testSerializeAsJson (): void
101- {
102- $ attribute = Attribute::tryFromValue ('foo ' );
103-
104- $ this ->assertInstanceOf (Attribute::class, $ attribute );
105-
106- $ this ->assertEquals (
107- ['type ' => 'string ' , 'value ' => 'foo ' ],
108- $ attribute ->jsonSerialize ()
109- );
110-
111- $ this ->assertEquals (
112- '{"type":"string","value":"foo"} ' ,
113- json_encode ($ attribute )
114- );
115- }
116-
117- public function testSerializeAsArray (): void
118- {
119- $ attribute = Attribute::tryFromValue ('foo ' );
120-
121- $ this ->assertInstanceOf (Attribute::class, $ attribute );
122-
123- $ this ->assertEquals (
124- ['type ' => 'string ' , 'value ' => 'foo ' ],
125- $ attribute ->toArray ()
126- );
127- }
128-
12999 public function testSerializeAsString (): void
130100 {
131101 $ attribute = Attribute::tryFromValue ('foo ' );
0 commit comments