Skip to content

Commit

Permalink
Closes #5577
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 27, 2023
1 parent d4972c3 commit d56f8ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog-10.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ All notable changes of the PHPUnit 10.5 release series are documented in this fi

* [#5532](https://github.com/sebastianbergmann/phpunit/issues/5532): `#[IgnoreDeprecations]` attribute to ignore `E_(USER_)DEPRECATED` issues on test class and test method level
* [#5551](https://github.com/sebastianbergmann/phpunit/issues/5551): Support for omitting parameter default values for `willReturnMap()`
* [#5577](https://github.com/sebastianbergmann/phpunit/issues/5577): `--composer-lock` CLI option for PHAR binary that displays the `composer.lock` used to build the PHAR

[10.5.0]: https://github.com/sebastianbergmann/phpunit/compare/10.4...10.5
2 changes: 2 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
</fileset>
</copy>

<copy file="${basedir}/composer.lock" tofile="${basedir}/build/tmp/phar/composer.lock"/>

<exec executable="${basedir}/build/scripts/phar-manifest.php" failonerror="true">
<arg path="${basedir}/build/tmp/phar/manifest.txt"/>
<arg path="${basedir}/build/tmp/phar/sbom.xml"/>
Expand Down
12 changes: 10 additions & 2 deletions build/templates/binary-phar-autoload.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ if (__FILE__ === realpath($_SERVER['SCRIPT_NAME'])) {
$execute = false;
}

$options = getopt('', array('manifest', 'sbom'));
$options = getopt('', array('composer-lock', 'manifest', 'sbom'));

if (isset($options['manifest'])) {
if (isset($options['composer-lock'])) {
$printComposerLock = true;
} elseif (isset($options['manifest'])) {
$printManifest = true;
} elseif (isset($options['sbom'])) {
$printSbom = true;
Expand Down Expand Up @@ -99,6 +101,12 @@ foreach ([___CLASSLIST___] as $file) {
require __PHPUNIT_PHAR_ROOT__ . '/phpunit/Framework/Assert/Functions.php';

if ($execute) {
if (isset($printComposerLock)) {
print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/composer.lock');

exit;
}

if (isset($printManifest)) {
print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/manifest.txt');

Expand Down

0 comments on commit d56f8ac

Please sign in to comment.