Skip to content

Commit 86817c2

Browse files
committed
test: add missing chain cases
1 parent cf80f5e commit 86817c2

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/member_chain/__snapshots__/jsfmt.spec.mjs.snap

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,12 @@ $var = Foo::keys($items)->filter(function ($x) { return $x > 2; })->map(function
454454
VarDumper::dump($item);
455455
});
456456
457+
$a->foo(get())->bar()->baz();
458+
$a->foo($b->method())->bar()->baz();
459+
$a->foo(fn() => 1)->bar()->baz();
460+
$a->foo(fn($x) => $x * 2)->bar()->baz();
461+
$a->foo(get(inner(deepest())))->bar()->baz();
462+
457463
=====================================output=====================================
458464
<?php
459465
@@ -593,6 +599,14 @@ new static(func_get_args())
593599
VarDumper::dump($item);
594600
});
595601
602+
$a->foo(get())->bar()->baz();
603+
$a->foo($b->method())->bar()->baz();
604+
$a->foo(fn() => 1)->bar()->baz();
605+
$a->foo(fn($x) => $x * 2)->bar()->baz();
606+
$a->foo(get(inner(deepest())))
607+
->bar()
608+
->baz();
609+
596610
================================================================================
597611
`;
598612

tests/member_chain/member_chain.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,9 @@
9292
(new static(func_get_args()))->offset(10)->push($this)->each(function ($item) {
9393
VarDumper::dump($item);
9494
});
95+
96+
$a->foo(get())->bar()->baz();
97+
$a->foo($b->method())->bar()->baz();
98+
$a->foo(fn() => 1)->bar()->baz();
99+
$a->foo(fn($x) => $x * 2)->bar()->baz();
100+
$a->foo(get(inner(deepest())))->bar()->baz();

0 commit comments

Comments
 (0)