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

RaisingDeprecationTestStub   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testDeprecation() 0 5 1
A multirunDataprovider() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests\Stub;
6
7
use PHPUnit\Framework\TestCase;
8
9
class RaisingDeprecationTestStub extends TestCase
10
{
11
    const DEPRECATION_MESSAGE = 'This "Foo" method is deprecated';
12
13
    /**
14
     * @dataProvider multirunDataprovider
15
     */
16
    public function testDeprecation()
17
    {
18
        $this->assertTrue(true, 'This avoids the risky status');
19
        @trigger_error(self::DEPRECATION_MESSAGE, E_USER_DEPRECATED);
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
20
    }
21
22
    public function multirunDataprovider()
23
    {
24
        return [
25
            [],
26
            [],
27
            [],
28
        ];
29
    }
30
}
31