| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 24 | public function testUnsanitisedLogFileFallback() { |
||
| 25 | touch($this->basePath . '/' . 'SomeSortOf Filename (UAT).log'); |
||
| 26 | |||
| 27 | $log = new DeploynautLogFile('SomeSortOf Filename (UAT).log', $this->basePath); |
||
| 28 | $this->assertEquals($log->getLogFilePath(), $this->basePath . '/SomeSortOf Filename (UAT).log'); |
||
|
1 ignored issue
–
show
|
|||
| 29 | $this->assertTrue($log->exists()); |
||
|
1 ignored issue
–
show
|
|||
| 30 | |||
| 31 | // writing into the logs still works, and we reference the old file path still. |
||
| 32 | $log->write('Some test content'); |
||
| 33 | $this->assertEquals($log->getLogFilePath(), $this->basePath . '/SomeSortOf Filename (UAT).log'); |
||
|
1 ignored issue
–
show
|
|||
| 34 | $this->assertContains('Some test content', $log->content()); |
||
| 35 | } |
||
| 36 | |||
| 61 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.