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

TestAbstract::setProperty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 4
nc 1
nop 3
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
}