diff --git a/CHANGELOG.md b/CHANGELOG.md index 717d6571..15474c01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This is the changelog between releases of PHPWord. Releases are listed in revers Place announcement text here. ### Changes +- Improved error message for the case when ``autoload.php`` is not found. - @RomanSyroeshko #371 - Changed visibility of all private properties and methods of ``TemplateProcessor`` to ``protected``. - RomanSyroeshko #498 - Improved performance of ``TemplateProcessor::setValue()``. - @RomanSyroeshko #513 - Renamed ``align`` option of ``Paragraph`` style into ``alignment``. Note: accessor and mutator methods are renamed too. - @RomanSyroeshko diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 4932a21b..6a1398a4 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -22,11 +22,16 @@ if (!defined('PHPWORD_TESTS_BASE_DIR')) { define('PHPWORD_TESTS_BASE_DIR', realpath(__DIR__)); } -$vendor = realpath(__DIR__ . '/../vendor'); -if (file_exists($vendor . '/autoload.php')) { - require $vendor . '/autoload.php'; +$vendorDirPath = realpath(__DIR__ . '/../vendor'); +if (file_exists($vendorDirPath . '/autoload.php')) { + require $vendorDirPath . '/autoload.php'; } else { - throw new Exception('Unable to load dependencies'); + throw new Exception( + sprintf( + 'Could not find file \'%s\'. It is generated by Composer. Use \'install\' or \'update\' Composer commands to move forward.', + $vendorDirPath . '/autoload.php' + ) + ); } spl_autoload_register(function ($class) {