Skip to content

Commit

Permalink
tests: test nested generators normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
romm committed Dec 26, 2023
1 parent 5351c78 commit 3d2a1e1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/Integration/Normalizer/NormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,33 @@ public function normalize_basic_values_yields_expected_output_data_provider(): i
],
];

yield 'nested iterable of scalar' => [
'input' => (function (): iterable {
yield 'strings' => (function(): iterable {
yield 'foo';
yield 'bar';
})();
yield 'integers' => (function(): iterable {
yield 42;
yield 1337;
})();
yield 'floats' => (function(): iterable {
yield 42.5;
yield 1337.404;
})();
yield 'booleans' => (function(): iterable {
yield true;
yield false;
})();
})(),
'expected' => [
'strings' => ['foo', 'bar'],
'integers' => [42, 1337],
'floats' => [42.5, 1337.404],
'booleans' => [true, false],
],
];

yield 'stdClass' => [
'input' => (function () {
$object = new stdClass();
Expand Down

0 comments on commit 3d2a1e1

Please sign in to comment.