mirror of
https://github.com/danog/amp.git
synced 2024-11-26 12:04:42 +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
|
||||
composer.lock
|
||||
coverage
|
||||
phpunit.xml
|
||||
vendor
|
||||
humbug.json
|
||||
|
@ -186,4 +186,30 @@ class ProducerTraitTest extends TestCase {
|
||||
$this->assertTrue($invoked);
|
||||
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