Skip to content

test/bootstrap.php and 'App.fullBaseUrl' #899

@OneHatRepo

Description

@OneHatRepo

Description

Hello. The tests/bootstrap.php file sets 'App.fullBaseUrl' even if this is already set in config/app_local.php.
This was causing issues for me in tests which call shell commands, like sending an email or formatting a PDF. It seems like it would be preferable to only set this value when it is not already set.

So instead of line 35 being as so:

if (empty($_SERVER['HTTP_HOST'])) {
    Configure::write('App.fullBaseUrl', 'http://localhost');
}

... it would first check for an existing value, as so:

if (empty($_SERVER['HTTP_HOST']) && !Configure::read('App.fullBaseUrl')) {
    Configure::write('App.fullBaseUrl', 'http://localhost');
}

CakePHP Version

4.3.0

PHP Version

7.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions