I understand that this isn't really needed, but it does allow us to ensure that all static caches are clear during testing and when the caches are cleared.

Files: 
CommentFileSizeAuthor
#9 libraries.flush-statics_0_reroll.patch706 byteststoeckler
PASSED: [[SimpleTest]]: [MySQL] 135 pass(es).
[ View ]
#7 libraries.flush-statics.patch581 byteststoeckler
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch libraries.flush-statics_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#4 libraries.test-cache-reset.4.patch485 bytessun
PASSED: [[SimpleTest]]: [MySQL] 128 pass(es).
[ View ]
#3 libraries.flush-statics.patch581 byteststoeckler
PASSED: [[SimpleTest]]: [MySQL] 128 pass(es).
[ View ]
static.patch1.12 KBRobLoach
PASSED: [[SimpleTest]]: [MySQL] 126 pass(es).
[ View ]

Comments

Status:Needs review» Needs work

Hmm... I'm fine with clearing the 'libraries_get_path' and 'libraries_info' in libraries_flush_caches, I think that's a good idea. I don't think we should be clearing 'libraries_load', though. That would mean that any library, that has been loaded prior to that call of libraries_flush_caches() could be loaded again afterwards, which would wreak terrible havoc. In that specific test, we are just interested in the contents of the $library array, we don't care about the actual files being loaded (twice), so we do that there.

hook_flush_caches() is not limited to testing, but invoked whenever drupal_flush_all_caches() is. If we want a helper for testing, then we should add that to a generic base testing class; i.e., LibrariesTestCase.

That said, we should split our tests into multiple test case classes (extending the base LibrariesTestCase) at some point.

Status:Needs work» Needs review
StatusFileSize
new581 bytes
PASSED: [[SimpleTest]]: [MySQL] 128 pass(es).
[ View ]

Something like this?

StatusFileSize
new485 bytes
PASSED: [[SimpleTest]]: [MySQL] 128 pass(es).
[ View ]

What I meant was: If this is for testing, then it should be available for testing only.

Overall, the discussion here is a bit hard though, as I don't see an actual use-case currently, so we're kinda designing into the blue.

Overall, the discussion here is a bit hard though, as I don't see an actual use-case currently, so we're kinda designing into the blue.

If this is seen as related to testing, then I think you're right.

I think flushing static caches in hook_flush_caches() is a good idea and something I would consider best practice, regardless of what we do in the test. I don't think I can come up with an actual use-case where you would want the statics to be reset, but if only for debugging purposes I would like that.

Status:Needs review» Reviewed & tested by the community
StatusFileSize
new581 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch libraries.flush-statics_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Still can't find anything wrong with #3. Re-uploading to see if it's still green. If so, I will commit this now.

Status:Reviewed & tested by the community» Needs work

The last submitted patch, libraries.flush-statics.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new706 bytes
PASSED: [[SimpleTest]]: [MySQL] 135 pass(es).
[ View ]

Here we go.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.