1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-02 09:37:57 +01:00
parallel/test/Worker/TaskFailureErrorTest.php
2020-02-14 12:55:38 -06:00

29 lines
802 B
PHP

<?php
namespace Amp\Parallel\Test\Worker;
use Amp\Parallel\Worker\TaskFailureError;
use Amp\PHPUnit\AsyncTestCase;
class TaskFailureErrorTest extends AsyncTestCase
{
public function testOriginalMethods(): void
{
$trace = [
[
'function' => 'error_message_trace',
'file' => 'file-name.php',
'line' => 1,
'args' => [],
]
];
$exception = new TaskFailureError('name', 'error_message', 0, $trace);
$this->assertSame('name', $exception->getOriginalClassName());
$this->assertSame('error_message', $exception->getOriginalMessage());
$this->assertSame(0, $exception->getOriginalCode());
$this->assertSame($trace, $exception->getOriginalTrace());
}
}