We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49f49f5 commit 00fee51Copy full SHA for 00fee51
src/test/php/lang/ast/syntax/php/unittest/RecordsTest.class.php
@@ -1,5 +1,6 @@
1
<?php namespace lang\ast\syntax\php\unittest;
2
3
+use lang\Error;
4
use lang\ast\Errors;
5
use lang\ast\unittest\emit\EmittingTest;
6
use lang\{IllegalArgumentException, XPClass};
@@ -183,4 +184,10 @@ public function destructure_and_map_person_record() {
183
184
return "{$name} is {$age} year(s) old";
185
}));
186
}
187
+
188
+ #[Test, Expect(class: Error::class, withMessage: '/Argument.+must.+callable/')]
189
+ public function destructure_with_incorrect_mapper() {
190
+ $p= $this->type('record <T>(int $x, int $y) { }')->newInstance(1, 10);
191
+ $p('not.callable');
192
+ }
193
0 commit comments