Skip to content

Commit

Permalink
Add tests for getAsyncContents
Browse files Browse the repository at this point in the history
  • Loading branch information
akondas committed Sep 2, 2020
1 parent d56e155 commit dffadbf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/Unit/Service/Downloader/ReactDownloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,16 @@ public function testLastModified(): void
});
$downloader->run();
}

public function testAsyncContent(): void
{
$downloader = new ReactDownloader();
$downloader->getAsyncContents('https://repman.io', [], function ($stream) {
self::assertIsResource($stream);
});
$downloader->getAsyncContents('/tmp/not-exists', [], function (int $timestamp): void {
throw new \LogicException('Should not happen');
});
$downloader->run();
}
}

0 comments on commit dffadbf

Please sign in to comment.