Completed
Pull Request — master (#71)
by Sullivan
02:06 queued 38s
created

TestCase::getMock()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
cc 1
nc 1
nop 1
rs 10
1
<?php
2
3
namespace SLLH\ComposerVersionsCheck\Tests;
4
5
// PHPUnit >=6 Backward Compatibility
6
if (class_exists('\PHPUnit\Framework\TestCase')) {
7
    abstract class TestCase extends \PHPUnit\Framework\TestCase
8
    {
9
        public function getMock($class)
10
        {
11
            return $this->getMockBuilder($class)->getMock();
12
        }
13
    }
14
} else {
15
    abstract class TestCase extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type SLLH\ComposerVersionsCheck\Tests\TestCase has been defined more than once; this definition is ignored, only the first definition in this file (L7-13) is considered.

This check looks for classes that have been defined more than once in the same file.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

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