TestCaseVersion7::expectExceptionCode()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 9.4285
cc 3
eloc 4
nc 2
nop 1
crap 12
1
<?php
2
/**
3
 * Common tests stuff
4
 *
5
 * @see       https://github.com/sergeymakinen/tests
6
 * @copyright Copyright (c) 2017-2018 Sergey Makinen (https://makinen.ru)
7
 * @license   https://github.com/sergeymakinen/tests/blob/master/LICENSE MIT License
8
 */
9
10
namespace SergeyMakinen\Tests;
11
12
use SergeyMakinen\Tests\Util\ExtensionTrait;
13
14
abstract class TestCaseVersion7 extends \PHPUnit\Framework\TestCase
15
{
16
    use ExtensionTrait;
17
18
    /**
19
     * @param int|string $code
20
     * @throws \Exception
21
     */
22
    public function expectExceptionCode($code): void
23
    {
24
        if (!is_int($code) && !is_string($code)) {
25
            throw \PHPUnit\Util\InvalidArgumentHelper::factory(1, 'integer or string');
26
        }
27
28
        parent::expectExceptionCode($code);
29
    }
30
}
31