public function testCancelPendingStreamWillReject()
 {
     $stream = new ReadableStream();
     $promise = Stream\buffer($stream);
     $promise->cancel();
     $this->expectPromiseReject($promise);
 }
 public function testFetchFileStream()
 {
     $file = 'jakarta/ecs/tags/V1_0/src/java/org/apache/ecs/AlignType.java';
     $revision = '168703';
     $promise = $this->viewvc->fetchFileStream($file, $revision);
     $recipe = Block\await(Stream\buffer($promise), $this->loop);
     $this->assertStringStartsWith('/*', $recipe);
 }
 /**
  * @depends testStartRunning
  * @param string $container
  */
 public function testExecStreamEmptyOutputWhileRunning($container)
 {
     $promise = $this->client->execCreate($container, array('true'));
     $exec = Block\await($promise, $this->loop);
     $this->assertTrue(is_array($exec));
     $this->assertTrue(is_string($exec['Id']));
     $stream = $this->client->execStartStream($exec['Id'], true);
     $stream->on('end', $this->expectCallableOnce());
     $output = Block\await(Stream\buffer($stream), $this->loop);
     $this->assertEquals('', $output);
 }
 /**
  * Returns a promise which resolves with the buffered stream contents of the given stream
  *
  * @param ReadableStreamInterface $stream
  * @return PromiseInterface Promise<string, Exception>
  */
 public function bufferedStream(ReadableStreamInterface $stream)
 {
     return Stream\buffer($stream);
 }