Completed
Pull Request — master (#1)
by Adam
06:20 queued 03:33
created

TestCase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getProtectedMethod() 0 7 1
1
<?php
2
3
namespace Equip\Queue;
4
5
use PHPUnit_Framework_TestCase as BaseTestCase;
6
use ReflectionClass;
7
use ReflectionMethod;
8
9
abstract class TestCase extends BaseTestCase
10
{
11
    /**
12
     * Make protected/private methods accessible
13
     *
14
     * @param object $class
15
     * @param string $name
16
     *
17
     * @return ReflectionMethod
18
     */
19
    public static function getProtectedMethod($class, $name)
20
    {
21
        $class = new ReflectionClass($class);
22
        $method = $class->getMethod($name);
23
        $method->setAccessible(true);
24
        return $method;
25
    }
26
}
27