- Issue created by @dpagini
- Merge request !10458[Test only]: Demonstrates #3491656 with setting homepage via config. β (Open) created by dpagini
This is tested in a few places by necessity but in
core/modules/system/tests/src/Functional/System/FrontPageTest.php
specificallly. Is that test missing something?- πΊπΈUnited States dpagini
Hey @cilefen, thanks for the updates to the issue, and great question. Wanted to first mention that I was only testing this within my project which was on 10.3, so I was certain the issue was there, but I do suspect this is also on 11.x as well.
Yeah, so I had the exact same thought and referenced that test you mentioned as I was trying to figure out what was going on. The best thought I can come up with is that this test is logging a user into Drupal (specifically with "access content" perm which is needed for the `/node` view), whereas my test is just accessing anonymously. I also thought that maybe my test would need to assign the "access content" permission, but I would have expected to see a 403 error if that was the case... instead I get a 200 status with the default /user/login page, so I don't think it's a permission error either. Maybe the logged in user approach is affecting the cache being served, maybe? I think that's probably the right path, but I don't have an exact answer... b/c that
::initFrontPage()
method is requesting the homepage as anonymous, and my test is then doing the same thing. Whereas in this existing core test, the setup is still requesting the homepage as anonymous, but the 2nd request to the homepage is with a logged in user.Did you have a chance to view the test I put up? Would you agree that what I'm doing in that test should be working?