-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathErrorExceptionTest.php
63 lines (51 loc) · 1.56 KB
/
ErrorExceptionTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/*
* This file is part of https://github.com/josantonius/php-error-handler repository.
*
* (c) Josantonius <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
*/
namespace Josantonius\ErrorHandler\Tests\ErrorHandler;
use PHPUnit\Framework\TestCase;
use Josantonius\ErrorHandler\ErrorHandled;
use Josantonius\ErrorHandler\ErrorException;
class ErrorExceptionTest extends TestCase
{
private ErrorException $errorException;
public function setUp(): void
{
parent::setUp();
$errorHandled = new ErrorHandled(
E_ERROR,
'Error message',
'Error.php',
8,
'Error'
);
$this->errorException = new ErrorException($errorHandled);
}
public function test_should_get_file(): void
{
$this->assertEquals('Error.php', $this->errorException->getFile());
}
public function test_should_get_message(): void
{
$this->assertEquals('Error message', $this->errorException->getMessage());
}
public function test_should_get_level(): void
{
$this->assertEquals(E_ERROR, $this->errorException->getLevel());
}
public function test_should_get_line(): void
{
$this->assertEquals(8, $this->errorException->getLine());
}
public function test_should_get_name(): void
{
$this->assertEquals('Error', $this->errorException->getName());
}
}