Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
libraries.test really is one ugly piece of ...
... annoying PHP code.
This is a first step, there's definitely lots more to do.
But this shouldn't hurt. Depending on how motivated I am to do more clean-up, I might commit this in a few days as is. Don't know yet.
Comment | File | Size | Author |
---|---|---|---|
#10 | libraries-slightly-better-tests-4.patch | 6.73 KB | tstoeckler |
#7 | libraries-slightly-better-tests-3.patch | 6.67 KB | tstoeckler |
#2 | libraries-slightly-better-tests-2.patch | 3.34 KB | tstoeckler |
libraries-slightly-better-tests.patch | 3.27 KB | tstoeckler | |
Comments
Comment #2
tstoecklerAhh, I'm an idiot.
Comment #4
sunWe will still need setUp() to load the libraries.module that contains the functions we want to call.
Tests can be run without installing the corresponding/originating module.
Missing "function " prefix here ;)
Comment #5
suntest methods are not static :)
As of now, we also don't specify any visibility for test methods, so just make that "function testFoo()"
Comment #6
tstoeckleroh God, I knew it was late, but I didn't think it'd be that late. :)
I guess I'll stop for now. This is getting worse and worse :)
Thanks for the review though.
I'll take this for a spin in the next few days.
Comment #7
tstoecklerHere we go.
Comment #9
sunThe unit test needs to manually load Libraries module, because it may not be enabled in the parent site that runs the test - hence, nothing in libraries.module is loaded.
I.e.:
Comment #10
tstoecklerAhh, I didn't know that. Thanks!
Comment #11
sunLooks good to me. Hopefully the testbot will confirm. :)
Comment #12
tstoecklerThanks again for the reviews.
Committed this to 7.x-2.x
http://drupal.org/commitlog/commit/10030/8f8f9b4594a4a001171834f193b242c...