-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathErrorHandledTest.php
60 lines (49 loc) · 1.44 KB
/
ErrorHandledTest.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
<?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;
class ErrorHandledTest extends TestCase
{
private ErrorHandled $errorHandled;
public function setUp(): void
{
parent::setUp();
$this->errorHandled = new ErrorHandled(
E_ERROR,
'Error message',
'Error.php',
8,
'Error'
);
}
public function test_should_get_file(): void
{
$this->assertEquals('Error.php', $this->errorHandled->getFile());
}
public function test_should_get_message(): void
{
$this->assertEquals('Error message', $this->errorHandled->getMessage());
}
public function test_should_get_level(): void
{
$this->assertEquals(E_ERROR, $this->errorHandled->getLevel());
}
public function test_should_get_line(): void
{
$this->assertEquals(8, $this->errorHandled->getLine());
}
public function test_should_get_name(): void
{
$this->assertEquals('Error', $this->errorHandled->getName());
}
}