| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 55 | public function createApplication() |
||
| 56 | { |
||
| 57 | $this->baseUrl = env('API_FULL_URL'); // this reads the value from `phpunit.xml` during testing |
||
| 58 | |||
| 59 | // override the default subDomain of the base URL when subDomain property is defined inside a test |
||
| 60 | if(property_exists($this, 'subDomain')){ |
||
| 61 | $this->overrideSubDomain($this->subDomain); |
||
|
|
|||
| 62 | } |
||
| 63 | |||
| 64 | $app = require __DIR__ . '/../../../../../bootstrap/app.php'; |
||
| 65 | |||
| 66 | $app->make(LaravelPort::class)->bootstrap(); |
||
| 67 | |||
| 68 | // create instance of faker and make it available in all tests |
||
| 69 | $this->faker = $app->make(Generator::class); |
||
| 70 | |||
| 71 | return $app; |
||
| 72 | } |
||
| 73 | } |
||
| 74 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: