Open luri-fr opened 5 months ago
Ok. In my libs/bin/pest file
, I have :
#!/usr/bin/env php
<?php
/**
* Proxy PHP file generated by Composer
*
* This file includes the referenced bin path (../pestphp/pest/bin/pest)
* using a stream wrapper to prevent the shebang from being output on PHP<8
*
* @generated
*/
namespace Composer;
$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
if (PHP_VERSION_ID < 80000) {
[...]
So, if I replace Line 54 of pestphp/pest/bin/pest
:
$vendorPath = dirname(__DIR__, 4).'/vendor/autoload.php';
by
$vendorPath = $GLOBALS['_composer_autoload_path'];
it's working for me. But this fix is linked to the version of composer (2.7.2) and i don't know in which version composer introduce $GLOBALS['_composer_autoload_path'] and which minimum version of composer you want to support. So I don't make PR. (I don't want to break other people.)
Well... not really working.
.\libs\bin\pest --init
create file in libs\bin\
directory and after I move the files .\libs\bin\pest
show :
INFO Cannot open bootstrap script "D:\[...]\MyOidc\vendor/autoload.php".
Ok I found.
In phpunit.xml, I must replace :
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
by
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
bootstrap="libs/autoload.php"
colors="true"
>
Perhaps this can be added in the documention ?
What Happened
I use composer config to change
vendor/
directory tolibs/
. (see : https://getcomposer.org/doc/06-config.md#vendor-dir ) But when I use./libs/bin/pest --init
, I have somes error :Composer explicitly support custom vendor directory, so Pest must support them.
I'll see if there's an easy modification I can make to correct this.
How to Reproduce
composer install --dev
./libs/bin/pest --init
Sample Repository
No response
Pest Version
2.34
PHP Version
8.2.16
Operation System
Windows
Notes
No response