From 34683f0e4c1bce5d3d684ae3694e8437904f92f2 Mon Sep 17 00:00:00 2001 From: Hannah Warmbier Date: Tue, 22 Nov 2016 12:33:15 -0600 Subject: [PATCH] Fix #125 --- src/Prefetcher.php | 4 ++-- tests/unit/PrefetcherTest.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Prefetcher.php b/src/Prefetcher.php index 9f32af9..b6c4160 100644 --- a/src/Prefetcher.php +++ b/src/Prefetcher.php @@ -33,7 +33,7 @@ public function fetchAll(IO\IOInterface $io, array $requests) $successCnt += $result['successCnt']; $failureCnt += $result['failureCnt']; foreach ($result['urls'] as $url) { - $io->writeError(" $successCnt/$totalCnt:\t$url"); + $io->writeError(" $successCnt/$totalCnt:\t$url", true, IO\IOInterface::VERBOSE); } } while ($multi->remain()); } catch (FetchException $e) { @@ -41,7 +41,7 @@ public function fetchAll(IO\IOInterface $io, array $requests) } $skippedCnt = $totalCnt - $successCnt - $failureCnt; - $io->writeError(" Finished: success: $successCnt, skipped: $skippedCnt, failure: $failureCnt, total: $totalCnt"); + $io->writeError(" Finished: success: $successCnt, skipped: $skippedCnt, failure: $failureCnt, total: $totalCnt", true, IO\IOInterface::VERBOSE); } /** diff --git a/tests/unit/PrefetcherTest.php b/tests/unit/PrefetcherTest.php index 46a6d8e..5c88460 100644 --- a/tests/unit/PrefetcherTest.php +++ b/tests/unit/PrefetcherTest.php @@ -1,6 +1,7 @@ 'file://uso800.txt', CURLOPT_FILE => tmpfile(), )); - $this->iop->writeError(" Finished: success: 0, skipped: 0, failure: 1, total: 1")->shouldBeCalledTimes(1); + $this->iop->writeError(" Finished: success: 0, skipped: 0, failure: 1, total: 1", true, IOInterface::VERBOSE)->shouldBeCalledTimes(1); $fetcher = new Prefetcher; $fetcher->fetchAll($this->iop->reveal(), array($reqp->reveal())); @@ -39,7 +40,7 @@ public function testFetchAllOnSuccess() )); $reqp->makeSuccess()->willReturn(null); $reqp->getMaskedURL()->willReturn('file://' . __DIR__ . '/test.txt'); - $this->iop->writeError(arg::type('string'))->shouldBeCalled(); + $this->iop->writeError(arg::type('string'), true, IOInterface::VERBOSE)->shouldBeCalled(); $fetcher = new Prefetcher; $fetcher->fetchAll($this->iop->reveal(), array($reqp->reveal()));