1
0
mirror of https://github.com/danog/amp.git synced 2024-11-27 04:24:42 +01:00
amp/test/PauseTest.php
2015-07-20 22:27:11 -04:00

27 lines
630 B
PHP

<?php
namespace Amp\Test;
use Amp\Pause;
use Amp\NativeReactor;
class PauseTest extends \PHPUnit_Framework_TestCase {
/**
* @dataProvider provideBadMillisecondArgs
* @expectedException \DomainException
* @expectedExceptionMessage Pause timeout must be greater than or equal to 1 millisecond
*/
public function testCtorThrowsOnBadMillisecondParam($arg) {
(new NativeReactor)->run(function ($reactor) use ($arg) {
new Pause($arg, $reactor);
});
}
public function provideBadMillisecondArgs() {
return [
[0],
[-1],
];
}
}