Skip to content

Commit 5cc82dd

Browse files
committed
Fix #29 (Add test for ErrorHandler::set)
1 parent 6b84924 commit 5cc82dd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/ErrorHandlerTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace AsyncInterop\Promise\Test;
4+
5+
use AsyncInterop\Promise;
6+
7+
class ErrorHandlerTest extends \PHPUnit_Framework_TestCase {
8+
function testSetReturnsPreviousErrorHandler() {
9+
$old = Promise\ErrorHandler::set($f = function() {});
10+
$expectedF = Promise\ErrorHandler::set($old);
11+
$this->assertEquals($f, $expectedF);
12+
}
13+
}

0 commit comments

Comments
 (0)