Changeset View
Changeset View
Standalone View
Standalone View
src/utils/__tests__/PhutilHashingIteratorTestCase.php
<?php | <?php | ||||
final class PhutilHashingIteratorTestCase extends PhutilTestCase { | final class PhutilHashingIteratorTestCase extends PhutilTestCase { | ||||
public function testHashingIterator() { | public function testHashingIterator() { | ||||
$path = dirname(__FILE__).'/hashingiterator/mostlyprime.txt'; | $path = __DIR__.'/hashingiterator/mostlyprime.txt'; | ||||
$stream = fopen($path, 'rb'); | $stream = fopen($path, 'rb'); | ||||
$algorithm = 'sha256'; | $algorithm = 'sha256'; | ||||
$stream_iterator = new PhutilStreamIterator($stream); | $stream_iterator = new PhutilStreamIterator($stream); | ||||
$hashing_iterator = id(new PhutilHashingIterator($stream_iterator)) | $hashing_iterator = id(new PhutilHashingIterator($stream_iterator)) | ||||
->setAlgorithm($algorithm); | ->setAlgorithm($algorithm); | ||||
Show All 31 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0