Test Failed
Branch master (9acec7)
by Agel_Nash
02:25
created

TestAbstract   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setProperty() 0 9 1
A getProperty() 0 9 1
A getMethod() 0 7 1
1
<?php namespace DocLister\Tests;
2
3
class TestAbstract extends \PHPUnit_Framework_TestCase
4
{
5
    public function getMethod($class, $method)
6
    {
7
        $reflection = new \ReflectionClass($class);
8
        $method = $reflection->getMethod($method);
9
        $method->setAccessible(true);
10
11
        return $method;
12
    }
13
14
    public function getProperty($class, $property)
15
    {
16
        $reflection = new \ReflectionClass($class);
17
18
        /** @var \ReflectionProperty $property */
19
        $property = $reflection->getProperty($property);
20
        $property->setAccessible(true);
21
22
        return $property->getValue($class);
23
    }
24
25
    public function setProperty($class, $property, $value)
26
    {
27
        $reflection = new \ReflectionClass($class);
28
29
        /** @var \ReflectionProperty $property */
30
        $property = $reflection->getProperty($property);
31
        $property->setAccessible(true);
32
33
        $property->setValue($class, $value);
34
    }
35
}