https://github.com/eviweb/composer-test-utils
Set of utilities to help testing Composer related components.
https://github.com/eviweb/composer-test-utils
Last synced: 4 months ago
JSON representation
Set of utilities to help testing Composer related components.
- Host: GitHub
- URL: https://github.com/eviweb/composer-test-utils
- Owner: eviweb
- License: mit
- Created: 2022-06-24T07:44:12.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-27T06:24:55.000Z (about 3 years ago)
- Last Synced: 2025-01-19T21:46:17.719Z (6 months ago)
- Language: PHP
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Composer Test Utils
Set of utilities to help testing Composer related components.
## Installation
Run `composer require eviweb/composer-test-utils`.
## Usage
### ComposerRunner
The `ComposerRunner` class offers a convenient way to run the composer command and get the related output.
```php
use Eviweb\Composer\Testing\ComposerRunner;$path = '/some/path';
$composer = new ComposerRunner();
$output = $composer->setWorkingDirectory($path)
->run('require', '--dev', 'vendor/package');
if ($composer->succeed()) {
print('It succeed and return the following output: '.$output);
} else {
print('It failed with the following error output: '.$output);
print('The value of $composer->failed() is true.');
}
```## License
This project is licensed under the terms of the [MIT License](LICENSE.md).