1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-02 17:52:14 +01:00
parallel/test/Sync/ExitFailureTest.php
Aaron Piotrowski b654463339
Fix code style
2018-10-07 09:50:45 -05:00

26 lines
662 B
PHP

<?php
namespace Amp\Parallel\Test\Sync;
use Amp\Parallel\Sync\ExitFailure;
use Amp\Parallel\Sync\PanicError;
use Amp\PHPUnit\TestCase;
class ExitFailureTest extends TestCase
{
public function testGetResult()
{
$message = "Test message";
$exception = new \Exception($message);
$result = new ExitFailure($exception);
try {
$result->getResult();
} catch (PanicError $caught) {
$this->assertGreaterThan(0, \stripos($caught->getMessage(), $message));
return;
}
$this->fail(\sprintf("Exception should be thrown from %s::getResult()", ExitFailure::class));
}
}