AbstractTestCase   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A expectExceptionClass() 0 6 2
1
<?php
2
namespace Thunder\Serializard\Tests;
3
4
use PHPUnit\Framework\TestCase;
5
6
/**
7
 * @author Tomasz Kowalczyk <[email protected]>
8
 */
9
abstract class AbstractTestCase extends TestCase
10
{
11
    public function expectExceptionClass($exception)
12
    {
13
        version_compare(PHP_VERSION, '7.0.0') > 0
14
            ? parent::expectException($exception)
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (expectException() instead of expectExceptionClass()). Are you sure this is correct? If so, you might want to change this to $this->expectException().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
15
            : $this->setExpectedException($exception);
0 ignored issues
show
Bug introduced by
The method setExpectedException() does not seem to exist on object<Thunder\Serializa...Tests\AbstractTestCase>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
16
    }
17
}
18