1
0
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:
Niklas Keller 2017-05-02 18:10:10 +02:00
parent f10321e5f8
commit 14cea0cbf0
2 changed files with 27 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
build build
composer.lock composer.lock
coverage
phpunit.xml phpunit.xml
vendor vendor
humbug.json humbug.json

View File

@ -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();
}
} }