1
0
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:
Niklas Keller 2017-04-23 19:08:40 +02:00
parent dc21d094c5
commit 05670678e1
11 changed files with 13 additions and 15 deletions

View File

@ -69,7 +69,7 @@ class AllTest extends \PHPUnit\Framework\TestCase {
}
/**
* @expectedException \Amp\UnionTypeError
* @expectedException \TypeError
*/
public function testNonPromise() {
Promise\all([1]);

View File

@ -100,7 +100,7 @@ class AnyTest extends \PHPUnit\Framework\TestCase {
}
/**
* @expectedException \Amp\UnionTypeError
* @expectedException \TypeError
*/
public function testNonPromise() {
Promise\any([1]);

View File

@ -141,7 +141,7 @@ class CaptureTest extends \PHPUnit\Framework\TestCase {
}
public function testNonPromise() {
$this->expectException(\Amp\UnionTypeError::class);
$this->expectException(\TypeError::class);
Promise\capture(42, \Error::class, function () {});
}
}

View File

@ -66,7 +66,7 @@ class ConcatTest extends \PHPUnit\Framework\TestCase {
}
/**
* @expectedException \Amp\UnionTypeError
* @expectedException \TypeError
*/
public function testNonStream() {
Stream\concat([1]);

View File

@ -76,7 +76,7 @@ class FirstTest extends \PHPUnit\Framework\TestCase {
}
/**
* @expectedException \Amp\UnionTypeError
* @expectedException \TypeError
*/
public function testNonPromise() {
Promise\first([1]);

View File

@ -60,7 +60,7 @@ class MergeTest extends \PHPUnit\Framework\TestCase {
}
/**
* @expectedException \Amp\UnionTypeError
* @expectedException \TypeError
*/
public function testNonStream() {
Stream\merge([1]);

View File

@ -110,7 +110,7 @@ class PipeTest extends \PHPUnit\Framework\TestCase {
}
public function testNonPromise() {
$this->expectException(\Amp\UnionTypeError::class);
$this->expectException(\TypeError::class);
Promise\pipe(42, function () {});
}
}

View File

@ -47,7 +47,7 @@ class RethrowTest extends TestCase {
}
public function testNonPromise() {
$this->expectException(\Amp\UnionTypeError::class);
$this->expectException(\TypeError::class);
Promise\rethrow(42);
}
}

View File

@ -94,7 +94,7 @@ class StreamFromIterableTest extends \PHPUnit\Framework\TestCase {
}
/**
* @expectedException \Amp\UnionTypeError
* @expectedException \TypeError
* @dataProvider provideInvalidStreamArguments
*/
public function testInvalid($arg) {

View File

@ -113,7 +113,7 @@ class TimeoutTest extends \PHPUnit\Framework\TestCase {
}
public function testNonPromise() {
$this->expectException(\Amp\UnionTypeError::class);
$this->expectException(\TypeError::class);
Promise\timeout(42, 42);
}
}

View File

@ -54,12 +54,10 @@ class WaitTest extends TestCase {
/**
* @expectedException \Error
* @expectedExceptionMessage Loop stopped without resolving promise
* @expectedExceptionMessage Loop stopped without resolving the promise
*/
public function testPromiseWithNoResolutionPathThrowsException() {
$promise = new Deferred;
$result = Promise\wait($promise->promise());
Promise\wait((new Deferred)->promise());
}
/**
@ -76,7 +74,7 @@ class WaitTest extends TestCase {
}
public function testNonPromise() {
$this->expectException(\Amp\UnionTypeError::class);
$this->expectException(\TypeError::class);
Promise\wait(42);
}
}