mirror of
https://github.com/danog/amp.git
synced 2024-11-30 04:29:08 +01:00
✅ Added further Internal\Producer tests
This commit is contained in:
parent
f10321e5f8
commit
14cea0cbf0
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
build
|
build
|
||||||
composer.lock
|
composer.lock
|
||||||
|
coverage
|
||||||
phpunit.xml
|
phpunit.xml
|
||||||
vendor
|
vendor
|
||||||
humbug.json
|
humbug.json
|
||||||
|
@ -186,4 +186,30 @@ class ProducerTraitTest extends TestCase {
|
|||||||
$this->assertTrue($invoked);
|
$this->assertTrue($invoked);
|
||||||
throw $reason;
|
throw $reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException \Error
|
||||||
|
* @expectedExceptionMessage The prior promise returned must resolve before invoking this method again
|
||||||
|
*/
|
||||||
|
public function testDoubleAdvance() {
|
||||||
|
$this->producer->advance();
|
||||||
|
$this->producer->advance();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException \Error
|
||||||
|
* @expectedExceptionMessage Promise returned from advance() must resolve before calling this method
|
||||||
|
*/
|
||||||
|
public function testGetCurrentBeforeAdvance() {
|
||||||
|
$this->producer->getCurrent();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException \Error
|
||||||
|
* @expectedExceptionMessage Iterator has already been completed
|
||||||
|
*/
|
||||||
|
public function testDoubleComplete() {
|
||||||
|
$this->producer->complete();
|
||||||
|
$this->producer->complete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user