Skip to content

Commit

Permalink
test: Add test for readonly properties from parent scope variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rust17 committed Aug 1, 2024
1 parent af33d06 commit d24e417
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/SerializerPhp81Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,20 @@ enum SerializerScopedBackedEnum: string {
});
})->with('serializers');

test('readonly properties from parent scope variable', function () {
$controller = new SerializerPhp81Controller();

$f = static function () use ($controller) {
return $controller;
};

$f = s($f);

expect($f()->service)->toBeInstanceOf(
SerializerPhp81Service::class,
);
})->with('serializers');

test('first-class callable with closures', function () {
$f = function ($value) {
return $value;
Expand Down

0 comments on commit d24e417

Please sign in to comment.