mirror of
https://github.com/danog/amp.git
synced 2024-11-26 20:15:00 +01:00
Fix tests regarding UnionTypeError
This commit is contained in:
parent
dc21d094c5
commit
05670678e1
@ -69,7 +69,7 @@ class AllTest extends \PHPUnit\Framework\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Amp\UnionTypeError
|
* @expectedException \TypeError
|
||||||
*/
|
*/
|
||||||
public function testNonPromise() {
|
public function testNonPromise() {
|
||||||
Promise\all([1]);
|
Promise\all([1]);
|
||||||
|
@ -100,7 +100,7 @@ class AnyTest extends \PHPUnit\Framework\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Amp\UnionTypeError
|
* @expectedException \TypeError
|
||||||
*/
|
*/
|
||||||
public function testNonPromise() {
|
public function testNonPromise() {
|
||||||
Promise\any([1]);
|
Promise\any([1]);
|
||||||
|
@ -141,7 +141,7 @@ class CaptureTest extends \PHPUnit\Framework\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testNonPromise() {
|
public function testNonPromise() {
|
||||||
$this->expectException(\Amp\UnionTypeError::class);
|
$this->expectException(\TypeError::class);
|
||||||
Promise\capture(42, \Error::class, function () {});
|
Promise\capture(42, \Error::class, function () {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ class ConcatTest extends \PHPUnit\Framework\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Amp\UnionTypeError
|
* @expectedException \TypeError
|
||||||
*/
|
*/
|
||||||
public function testNonStream() {
|
public function testNonStream() {
|
||||||
Stream\concat([1]);
|
Stream\concat([1]);
|
||||||
|
@ -76,7 +76,7 @@ class FirstTest extends \PHPUnit\Framework\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Amp\UnionTypeError
|
* @expectedException \TypeError
|
||||||
*/
|
*/
|
||||||
public function testNonPromise() {
|
public function testNonPromise() {
|
||||||
Promise\first([1]);
|
Promise\first([1]);
|
||||||
|
@ -60,7 +60,7 @@ class MergeTest extends \PHPUnit\Framework\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Amp\UnionTypeError
|
* @expectedException \TypeError
|
||||||
*/
|
*/
|
||||||
public function testNonStream() {
|
public function testNonStream() {
|
||||||
Stream\merge([1]);
|
Stream\merge([1]);
|
||||||
|
@ -110,7 +110,7 @@ class PipeTest extends \PHPUnit\Framework\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testNonPromise() {
|
public function testNonPromise() {
|
||||||
$this->expectException(\Amp\UnionTypeError::class);
|
$this->expectException(\TypeError::class);
|
||||||
Promise\pipe(42, function () {});
|
Promise\pipe(42, function () {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ class RethrowTest extends TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testNonPromise() {
|
public function testNonPromise() {
|
||||||
$this->expectException(\Amp\UnionTypeError::class);
|
$this->expectException(\TypeError::class);
|
||||||
Promise\rethrow(42);
|
Promise\rethrow(42);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ class StreamFromIterableTest extends \PHPUnit\Framework\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Amp\UnionTypeError
|
* @expectedException \TypeError
|
||||||
* @dataProvider provideInvalidStreamArguments
|
* @dataProvider provideInvalidStreamArguments
|
||||||
*/
|
*/
|
||||||
public function testInvalid($arg) {
|
public function testInvalid($arg) {
|
||||||
|
@ -113,7 +113,7 @@ class TimeoutTest extends \PHPUnit\Framework\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testNonPromise() {
|
public function testNonPromise() {
|
||||||
$this->expectException(\Amp\UnionTypeError::class);
|
$this->expectException(\TypeError::class);
|
||||||
Promise\timeout(42, 42);
|
Promise\timeout(42, 42);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,12 +54,10 @@ class WaitTest extends TestCase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Error
|
* @expectedException \Error
|
||||||
* @expectedExceptionMessage Loop stopped without resolving promise
|
* @expectedExceptionMessage Loop stopped without resolving the promise
|
||||||
*/
|
*/
|
||||||
public function testPromiseWithNoResolutionPathThrowsException() {
|
public function testPromiseWithNoResolutionPathThrowsException() {
|
||||||
$promise = new Deferred;
|
Promise\wait((new Deferred)->promise());
|
||||||
|
|
||||||
$result = Promise\wait($promise->promise());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -76,7 +74,7 @@ class WaitTest extends TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testNonPromise() {
|
public function testNonPromise() {
|
||||||
$this->expectException(\Amp\UnionTypeError::class);
|
$this->expectException(\TypeError::class);
|
||||||
Promise\wait(42);
|
Promise\wait(42);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user