Total Complexity | 2 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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; |
||
50 |