diff --git a/tests/unit/Framework/MockObject/ReturnValueGeneratorTest.php b/tests/unit/Framework/MockObject/ReturnValueGeneratorTest.php index 6529d5854a0..c65c1a0af53 100644 --- a/tests/unit/Framework/MockObject/ReturnValueGeneratorTest.php +++ b/tests/unit/Framework/MockObject/ReturnValueGeneratorTest.php @@ -120,17 +120,35 @@ public function test_Generates_callable_for_Closure(): void public function test_Generates_Generator_for_Generator(): void { - $this->assertInstanceOf(Generator::class, $this->generate('Generator')); + $value = $this->generate('Generator'); + + $this->assertInstanceOf(Generator::class, $value); + + foreach ($value as $element) { + $this->assertSame([], $element); + } } public function test_Generates_Generator_for_Traversable(): void { - $this->assertInstanceOf(Generator::class, $this->generate('Traversable')); + $value = $this->generate('Traversable'); + + $this->assertInstanceOf(Generator::class, $value); + + foreach ($value as $element) { + $this->assertSame([], $element); + } } public function test_Generates_Generator_for_iterable(): void { - $this->assertInstanceOf(Generator::class, $this->generate('iterable')); + $value = $this->generate('iterable'); + + $this->assertInstanceOf(Generator::class, $value); + + foreach ($value as $element) { + $this->assertSame([], $element); + } } public function test_Generates_test_stub_for_class_or_interface_name(): void