Skip to content

Instantly share code, notes, and snippets.

@mariano
Last active October 11, 2023 13:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariano/328a0f41c678113bf573e6d5d6c1aa03 to your computer and use it in GitHub Desktop.
Save mariano/328a0f41c678113bf573e6d5d6c1aa03 to your computer and use it in GitHub Desktop.
$inputFile = Mockery::mock(SplFileObject::class, ["php://memory"]);
$inputFile->shouldReceive("setMaxLineLen")
->with(Csv::MAXIMUM_LINE_LENGTH)
->once()
->shouldReceive("eof")
->with()
->andReturn(false)
->once()
->shouldReceive("fgets")
->with()
->andReturn("LINE1")
->shouldReceive("eof")
->with()
->andReturn(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment