@@ -24,7 +24,6 @@ protected function setUp(): void
2424 public function testGetSubscribingMethods (): void
2525 {
2626 $ methods = DateFormatInterfaceHandler::getSubscribingMethods ();
27- $ this ->assertIsArray ($ methods ); // @phpstan-ignore method.alreadyNarrowedType
2827 $ this ->assertNotEmpty ($ methods );
2928
3029 // Check that all expected types are present
@@ -47,18 +46,6 @@ public function testGetSubscribingMethods(): void
4746 $ this ->assertContains (GraphNavigatorInterface::DIRECTION_DESERIALIZATION , $ directions );
4847 }
4948
50- public function testConstructorWithDefaultParameters (): void
51- {
52- $ handler = new DateFormatInterfaceHandler ();
53- $ this ->assertInstanceOf (DateFormatInterfaceHandler::class, $ handler );
54- }
55-
56- public function testConstructorWithCustomParameters (): void
57- {
58- $ handler = new DateFormatInterfaceHandler ('Y-m-d ' , 'America/New_York ' );
59- $ this ->assertInstanceOf (DateFormatInterfaceHandler::class, $ handler );
60- }
61-
6249 public function testSerializeNullDateTime (): void
6350 {
6451 $ nullDateTime = new NullDateTime ();
@@ -85,18 +72,6 @@ public function testDeserializeNullOrEmptyStringReturnsNullDateTime(): void
8572 $ this ->assertInstanceOf (NullDateTime::class, $ result ->getExpires ());
8673 }
8774
88- public function testDeserializeEmptyStringReturnsNullDateTime (): void
89- {
90- // Test using the actual serializer to deserialize a Cookie with empty string expires datetime
91- $ serializer = new \Deviantintegral \Har \Serializer ();
92-
93- $ json = '{"name": "test", "value": "value", "expires": ""} ' ;
94- $ result = $ serializer ->getSerializer ()->deserialize ($ json , \Deviantintegral \Har \Cookie::class, 'json ' );
95-
96- $ this ->assertInstanceOf (\Deviantintegral \Har \Cookie::class, $ result );
97- $ this ->assertInstanceOf (NullDateTime::class, $ result ->getExpires ());
98- }
99-
10075 public function testDeserializeValidDateTimeReturnsConcreteDateTime (): void
10176 {
10277 // Test using the actual serializer to deserialize a Cookie with valid expires datetime
@@ -107,30 +82,5 @@ public function testDeserializeValidDateTimeReturnsConcreteDateTime(): void
10782
10883 $ this ->assertInstanceOf (\Deviantintegral \Har \Cookie::class, $ result );
10984 $ this ->assertInstanceOf (\Deviantintegral \NullDateTime \ConcreteDateTime::class, $ result ->getExpires ());
110- $ this ->assertNotInstanceOf (NullDateTime::class, $ result ->getExpires ());
111- }
112-
113- public function testDeserializeLogicalOrCondition (): void
114- {
115- // This test kills Identical and LogicalOr mutations by verifying the exact behavior
116- // of the condition: if (null === $data || '' === $data)
117- $ serializer = new \Deviantintegral \Har \Serializer ();
118-
119- // Test empty string - should return NullDateTime
120- $ jsonEmpty = '{"name": "test", "value": "value", "expires": ""} ' ;
121- $ resultEmpty = $ serializer ->getSerializer ()->deserialize ($ jsonEmpty , \Deviantintegral \Har \Cookie::class, 'json ' );
122- $ this ->assertInstanceOf (NullDateTime::class, $ resultEmpty ->getExpires (), 'Empty string should return NullDateTime ' );
123-
124- // Test valid datetime - should NOT return NullDateTime
125- $ jsonValid = '{"name": "test", "value": "value", "expires": "2023-01-15T10:30:00.000Z"} ' ;
126- $ resultValid = $ serializer ->getSerializer ()->deserialize ($ jsonValid , \Deviantintegral \Har \Cookie::class, 'json ' );
127- $ this ->assertNotInstanceOf (NullDateTime::class, $ resultValid ->getExpires (), 'Valid datetime should NOT return NullDateTime ' );
128- $ this ->assertInstanceOf (\Deviantintegral \NullDateTime \ConcreteDateTime::class, $ resultValid ->getExpires ());
129-
130- // This test specifically kills these mutants:
131- // 1. Identical: if (null !== $data || '' === $data)
132- // Would cause empty string to try parsing as datetime (error) instead of returning NullDateTime
133- // 2. LogicalOrAllSubExprNegation: if (!(null === $data) || !('' === $data))
134- // Would be true for valid strings, incorrectly returning NullDateTime for valid dates
13585 }
13686}
0 commit comments