| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 34 | public function testRelativePath(): void |
||
| 35 | { |
||
| 36 | $files = new Files(); |
||
| 37 | |||
| 38 | $this->assertSame( |
||
| 39 | 'some-filename.txt', |
||
| 40 | $files->relativePath('/abc/some-filename.txt', '/abc') |
||
| 41 | ); |
||
| 42 | |||
| 43 | $this->assertSame( |
||
| 44 | '../some-filename.txt', |
||
| 45 | $files->relativePath('/abc/../some-filename.txt', '/abc') |
||
| 46 | ); |
||
| 47 | |||
| 48 | $this->assertSame( |
||
| 49 | '../../some-filename.txt', |
||
| 50 | $files->relativePath('/abc/../../some-filename.txt', '/abc') |
||
| 51 | ); |
||
| 52 | |||
| 53 | $this->assertSame( |
||
| 54 | './some-filename.txt', |
||
| 55 | $files->relativePath('/abc/some-filename.txt', '/abc/..') |
||
| 56 | ); |
||
| 57 | |||
| 58 | $this->assertSame( |
||
| 59 | '../some-filename.txt', |
||
| 60 | $files->relativePath('/abc/some-filename.txt', '/abc/../..') |
||
| 61 | ); |
||
| 64 |