| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | public function testFormat() |
||
| 19 | { |
||
| 20 | $fileSystem = static::$container->get('filesystem'); |
||
| 21 | $formatService = static::$container->get('decline_transformat.format'); |
||
| 22 | |||
| 23 | $fileUnformatted = static::RESOURCES_DIR . '/' . static::TRANSLATION_UNFORMATTED; |
||
| 24 | $fileFormatted = static::RESOURCES_DIR . '/' . static::TRANSLATION_FORMATTED; |
||
| 25 | $fileExpected = static::RESOURCES_DIR . '/' . static::TRANSLATION_EXPECTED; |
||
| 26 | |||
| 27 | // create a copy of the unformatted file |
||
| 28 | $fileSystem->copy($fileUnformatted, $fileFormatted); |
||
| 29 | |||
| 30 | // format the unformatted file |
||
| 31 | $formatService->format(null, '../' . static::TRANSLATION_FORMATTED); |
||
| 32 | |||
| 33 | // formatted file should be equal to expected file |
||
| 34 | $this->assertFileEquals($fileExpected, $fileFormatted); |
||
| 35 | |||
| 36 | // cleanup by removing formatted file |
||
| 37 | $fileSystem->remove([$fileFormatted]); |
||
| 38 | } |
||
| 39 | } |