Closed (won't fix)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
3 May 2012 at 05:03 UTC
Updated:
29 Jul 2014 at 20:40 UTC
Jump to comment: Most recent file
test* method in a test caseCommonJavaScriptTestCase and realizing that none of the gazillion test methods needs a completely fresh Drupal site.CommonJavaScriptTestCase so there is only one test method (but retaining the test method comments as inline comments)CommonJavaScriptDefaultsTestCase test case into the former (if it exists already)| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1558706_1_js_tests.patch | 11.28 KB | cosmicdreams |
Comments
Comment #1
cosmicdreams commentedAwesome description sun. and it sounds fun. I'll try to do this one tonight.
Comment #2
cosmicdreams commentedhalf-way done. Seeing how the tests respond
Comment #4
sunThis restore of config can be entirely removed.
Each new test needs to start with a reset, so previous drupal_add_js() calls do not interfere with new ones.
It would be a good idea to add a custom resetJS() method to this test, which performs the reset, so it can possibly be easily adjusted in one place later.
Comment #5
sunI'm sorry to do this, but in the meantime, #1411074: Add a flag to set up test environment only once per test class; introduce setUpBeforeClass() and tearDownAfterClass() [PHPUnit] is the actual and real solution, which makes this issue obsolete and kinda approaches the problem from the opposite direction.
CommonJavaScriptTestCase was already fixed in there.
Regardless of that, thanks for jumping on this issue and trying to resolve it! :)