Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
| ComposerSystemInterface | |
0.00% |
0 / 4 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
| |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | ||||
| exit | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| putFileContents | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getcwd | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare( strict_types = 1 ); |
| 4 | |
| 5 | namespace MediaWiki\Composer; |
| 6 | |
| 7 | /** |
| 8 | * Wrapper around low-level system functions, so that we can inject mocks |
| 9 | * when testing the MediaWiki\Composer\ComposerLaunchParallel class. |
| 10 | * |
| 11 | * @license GPL-2.0-or-later |
| 12 | */ |
| 13 | class ComposerSystemInterface { |
| 14 | |
| 15 | public function print( string $message ) { |
| 16 | print( $message ); |
| 17 | } |
| 18 | |
| 19 | public function exit( int $resultCode ) { |
| 20 | exit( $resultCode ); |
| 21 | } |
| 22 | |
| 23 | public function putFileContents( string $path, string $data ) { |
| 24 | file_put_contents( $path, $data ); |
| 25 | } |
| 26 | |
| 27 | public function getcwd(): string { |
| 28 | return getcwd(); |
| 29 | } |
| 30 | } |