1
0
mirror of https://github.com/danog/amp.git synced 2025-01-22 05:11:42 +01:00

Better error message when emitting after resolve

This commit is contained in:
Aaron Piotrowski 2017-01-07 12:25:04 -06:00
parent cba57dd81e
commit cf5ebb1408
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ trait Producer {
*/
private function emit($value): Promise {
if ($this->resolved) {
throw new \Error("The stream has been resolved; cannot emit more values");
throw new \Error("Streams cannot emit values after calling resolve");
}
if ($value instanceof Promise) {

View File

@ -137,7 +137,7 @@ class ProducerTraitTest extends \PHPUnit_Framework_TestCase {
/**
* @depends testEmit
* @expectedException \Error
* @expectedExceptionMessage The stream has been resolved; cannot emit more values
* @expectedExceptionMessage Streams cannot emit values after calling resolve
*/
public function testEmitAfterResolve() {
$this->producer->resolve();