Completed
Branch testing (7f3043)
by Hennik
05:13
created

BaseTestCase   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 13
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A assertException() 0 6 2
A tearDown() 0 3 1
1
<?php
2
3
abstract class BaseTestCase extends PHPUnit_Framework_TestCase
4
{
5
    public function tearDown()
6
    {
7
        Mockery::close();
8
    }
9
10
    protected function assertException($exceptionName)
11
    {
12
        if (method_exists(parent::class, 'expectException')) {
13
            parent::expectException($exceptionName);
14
        } else {
15
            $this->setExpectedException($exceptionName);
1 ignored issue
show
Deprecated Code introduced by
The function PHPUnit_Framework_TestCase::setExpectedException() has been deprecated: Method deprecated since Release 5.2.0; use expectException() instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

15
            /** @scrutinizer ignore-deprecated */ $this->setExpectedException($exceptionName);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
16
        }
17
    }
18
}
19