简体   繁体   中英

Set project base URL in functional testing with Laravel 5 / Codeception

Is there a way to dynamically set the project URL during Laravel 5 Codeception functional tests ?

Currently, the base URL is localhost but I try to write a test for a PDF generation with the Snappy module and the binary returns and error because my css sheet is not charged (the binary need an absolute path).

I have set an .env.testing file configured with my testing database configuration and the APP_URL path specified with my app url but it does not change anything. The base URL is still localhost during my tests.

Would you think it could be possible to overwrite the base URL during my functional testing ?

从 Laravel 5.4 我在我的 PHPUnit 测试中使用它,它可能也适用于 Codeception:

\URL::forceRootUrl('http://my.root.url.com');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM