1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-16 20:28:28 +01:00

Tests: Helper\E107Base: Use more reliable check for Composer 2 format

Issue reported in Gitter:
https://matrix.to/#/!srhnCKlMgxFeuSPXPb:gitter.im/$nGHXf-miT7JsA2U-Mgr7_SDuINfSYjuHulMgfuvPNdg?via=gitter.im

Tester reported this error:

```
In E107Base.php line 103:

  First parameter must either be an object or the name of an existing class
```
This commit is contained in:
Nick Liu 2023-02-16 15:47:56 +01:00
parent f2af17d45f
commit 432395c12e
No known key found for this signature in database
GPG Key ID: 1167C5F9C9897637

View File

@ -100,7 +100,7 @@ abstract class E107Base extends Base
{
$composer_installed_file = codecept_absolute_path("vendor/composer/installed.json");
$composer_installed = json_decode(file_get_contents($composer_installed_file));
if (property_exists($composer_installed, "packages"))
if (isset($composer_installed->packages))
{
// Composer 2 format for the installed packages manifest
$composer_installed = $composer_installed->packages;