Test Failed
Pull Request — master (#132)
by Alessandro
03:15
created

RaisingNoticeTestStub   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testRaise() 0 5 1
A errorProvider() 0 8 1
A testVarDump() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests\Stub;
6
7
use PHPUnit\Framework\TestCase;
8
9
/**
10
 * Class RaisingNoticeTestStub
11
 * @package Tests\Stub
12
 */
13
class RaisingNoticeTestStub extends TestCase
14
{
15
    /**
16
     * @dataProvider errorProvider
17
     */
18
    public function testRaise($errorMessage, $errorLevel)
19
    {
20
        trigger_error($errorMessage, $errorLevel);
21
        $this->fail();
22
    }
23
24
    public function errorProvider(): array
25
    {
26
        return [
27
            ['YOU SHOULD NOT SEE THIS -- E_USER_NOTICE', E_USER_NOTICE],
28
            ['YOU SHOULD NOT SEE THIS -- E_USER_WARNING', E_USER_WARNING],
29
            ['YOU SHOULD NOT SEE THIS -- E_USER_ERROR', E_USER_ERROR],
30
        ];
31
    }
32
33
    public function testVarDump()
34
    {
35
        var_dump('YOU SHOULD NOT SEE THIS -- var_dump');
0 ignored issues
show
Security Debugging Code introduced by
var_dump('YOU SHOULD NOT SEE THIS -- var_dump'); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
36
        $this->fail();
37
    }
38
}
39