Problem/Motivation
Original discovered in #2380389-169: Use a single vendor directory in the root.
rebuild.php bypasses autoload.php and includes core/vendor/autoload.php directly.
Proposed resolution
Add test coverage for rebuild.php similar to \Drupal\system\Tests\Update\UpdateScriptTest.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #41 | 2575267-40.patch | 1.65 KB | voleger |
| #41 | interdiff-2575267-39-40.txt | 484 bytes | voleger |
| #39 | 2575267-39.patch | 1.64 KB | voleger |
| #39 | interdiff-2575267-33-39.txt | 2.24 KB | voleger |
| #33 | interdiff-20-33.txt | 545 bytes | MerryHamster |
Comments
Comment #2
mile23Check out my comment here: https://www.drupal.org/node/2380389#comment-10376025
rebuild.phpneeds more than tests, IMO, so that we can rely on behavior from different systems that need to deal with the cache.Comment #3
hussainwebJust the first step. Tests pending.
Comment #4
jibranComment #5
webflo commentedComment #6
webflo commentedComment #11
kgoel commentedwhile debugging RebuildScriptTest.php and found that cURL used to handle URLs with a fragment by including fragment in the request to the server which has been fixed in cURL 7.20 so I have reverted https://www.drupal.org/node/671520 in this patch. It could be separate out in different issue if removal of more than 5 year code is out of scope in this issue.
Comment #13
kgoel commentedtstoeckler and I were looking at it together. We couldn't find any instance of cURL handling fragments in the URL. We thought about it and we are considering to remove the cURL redirect handling from core and revert #11patch and re-add custom handling of fragments in Drupal way.
Comment #15
kgoel commentedWorked off of #6patch and posting what I have so far.
Comment #16
kgoel commentedComment #19
webchickThis is a big deal. We almost committed the wrong class load path in #2380389: Use a single vendor directory in the root due to lacking this test coverage.
Comment #20
webflo commentedComment #21
webflo commentedAssertions on redirects without scheme and hostname are completely broken in Simpletest
Comment #22
mile23Patch still applies, the test runs and passes. Just one thing...
Should be
$this->container->get('cache.default');, fixable on commit, or ignorable given that we're not consistently using the fixture anyway.Comment #24
mile23Re-running the test because it's unclear whether the failing test was unrelated.
Comment #29
mile23Needs to not be a
WebTestBasetest.Comment #31
MerryHamster commentedPatch for 8.6.x and fixed #22
Comment #32
MerryHamster commentedComment #33
MerryHamster commentedoops, forgot to change version.
Adding again. Patch for 8.6.x and fixed #22
Comment #35
andypostnot all cases covered
missing schemaAndHost
Comment #36
dawehnerLet's directly with extensing
BrowserTestBase. Please ask if you need some help.Comment #37
borisson_Setting to needs work based on #36.
Comment #39
volegerComment #41
volegerComment #42
volegerComment #43
mile23Patch still applies, re-running test.
Comment #44
mile23Test in #41 tests these things:
It'd be great if it had inline comments to say all that. But that's a nit.
Re: #19 - I'm not sure how we'd test for using the wrong autoload.php file, other than token analysis. That seems like a long way to go for something we don't do on other scripts.
And, for the record, I ran the test in #41 after modifying rebuild.php to require vendor/autoload.php. It passed.
RTBC here so we can have some coverage rather than perfect coverage.
Comment #45
alexpottCommitted and pushed a3270cd3d1 to 8.7.x. Thanks!
I agree with @Mile23 some test coverage is better than none.