Passed
Push — master ( 85903d...ffeb92 )
by Peter
09:09 queued 06:41
created

TestCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 10
c 1
b 0
f 0
dl 0
loc 40
rs 10
1
<?php
2
3
namespace Pixelpeter\Genderize;
4
5
use ReflectionClass;
6
7
abstract class TestCase extends \Illuminate\Foundation\Testing\TestCase
8
{
9
    /**
10
     * The base URL to use while testing the application.
11
     *
12
     * @var string
13
     */
14
    protected $baseUrl = 'http://localhost';
15
16
    /**
17
     * Creates the application.
18
     *
19
     * @return \Illuminate\Foundation\Application
20
     */
21
    public function createApplication()
22
    {
23
        $app = require __DIR__.'/../vendor/laravel/laravel/bootstrap/app.php';
24
25
        $app->register(\Pixelpeter\Genderize\GenderizeServiceProvider::class);
26
27
        $app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
28
29
        return $app;
30
    }
31
32
    /**
33
     * getPrivateProperty
34
     *
35
     * @author    Joe Sexton <[email protected]>
36
     *
37
     * @param  string  $className
38
     * @param  string  $propertyName
39
     * @return \ReflectionProperty
40
     */
41
    public function getPrivateProperty($className, $propertyName)
42
    {
43
        $reflector = new ReflectionClass($className);
44
        $property = $reflector->getProperty($propertyName);
45
        $property->setAccessible(true);
46
47
        return $property;
48
    }
49
}
50