expectException(InvalidArgumentException::class); /* @phpstan-ignore-next-line */ new StreamChunks(false); } public function testGeneratorYieldsData() { $result = iterator_to_array(new StreamChunks(fopen('data://text/plain,test', 'r'))); $this->assertSame(['test'], $result); } }