Skip to content

Conversation

@TavoNiievez
Copy link
Member

No description provided.

@TavoNiievez TavoNiievez added this to the 2.0.0 milestone Jan 25, 2021
$autoLoader = codecept_root_dir() . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

if (file_exists($autoLoader)) {
require_once $autoLoader;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is odd, I think its only purpose was to get CI working, because it runs composer install in two separate directories.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it seems that it is, and it is still necessary... if I remove it I get:
PHP Fatal error: Uncaught Error: Class 'Symfony\Component\HttpKernel\Kernel' not found in /home/runner/work/module-symfony/module-symfony/framework-tests/src/Kernel.php:12
So I opted to encapsulate it in a separate method improving its documentation:

    /**
     * Ensures autoloader loading of additional directories.
     * It is only required for CI jobs to run correctly.
     */
    private function requireAdditionalAutoloader(): void
    {
        $autoLoader = codecept_root_dir() . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
        if (file_exists($autoLoader)) {
            require_once $autoLoader;
        }
    }

@TavoNiievez TavoNiievez changed the title Update dependencies and code standards Update code standards Jan 27, 2021
@TavoNiievez TavoNiievez marked this pull request as ready for review January 27, 2021 19:45
@TavoNiievez TavoNiievez merged commit 27ea512 into Codeception:master Jan 27, 2021
@TavoNiievez TavoNiievez deleted the update-depend-and-standars branch January 27, 2021 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants