@@ -45,12 +45,7 @@ public function testMagicSetThrowsException(): void
4545 $ payload = new Payload (['key ' => 'value ' ]);
4646 $ this ->expectException (SchemaException::class);
4747 $ this ->expectExceptionMessage ('Cannot modify payload properties ' );
48-
49- // Use a closure to test the exception since readonly classes don't allow dynamic properties
50- $ test = function () use ($ payload ) {
51- $ payload ->__set ('key ' , 'new_value ' );
52- };
53- $ test ();
48+ $ payload ->__set ('key ' , 'new_value ' );
5449 }
5550
5651 public function testResolveWithScalarValue (): void
@@ -85,7 +80,7 @@ public function testNestedPayloadAccess(): void
8580 ]
8681 ]
8782 ]);
88- $ this ->assertEquals ('deep_value ' , $ payload ->level1 ->level2 ->level3 );
83+ $ this ->assertEquals ('deep_value ' , $ payload ->level1 ? ->level2? ->level3);
8984 }
9085
9186 public function testInheritedGetMethod (): void
@@ -113,7 +108,6 @@ public function testInheritedWithMethod(): void
113108 {
114109 $ payload = new Payload (['key ' => 'value ' ]);
115110 $ newPayload = $ payload ->with ('new_key ' , 'new_value ' );
116- $ this ->assertInstanceOf (Payload::class, $ newPayload );
117111 $ this ->assertEquals ('new_value ' , $ newPayload ->get ('new_key ' ));
118112 $ this ->assertEquals ('value ' , $ newPayload ->get ('key ' ));
119113 }
@@ -122,7 +116,6 @@ public function testInheritedAlongMethod(): void
122116 {
123117 $ payload = new Payload (['key ' => 'value ' ]);
124118 $ newPayload = $ payload ->along (['new_key ' => 'new_value ' ]);
125- $ this ->assertInstanceOf (Payload::class, $ newPayload );
126119 $ this ->assertEquals ('new_value ' , $ newPayload ->get ('new_key ' ));
127120 $ this ->assertEquals ('value ' , $ newPayload ->get ('key ' ));
128121 }
0 commit comments