Call l for the current page with and without a class set in $options and assert that the active class is properly added.
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | 296326-l-active-test.patch | 1.5 KB | mr.baileys |
| #23 | 296326_l_class_test_3.patch | 5.48 KB | kscheirer |
| #21 | 296326_l_class_test_2.patch | 2.67 KB | kscheirer |
| #19 | 296326_l_class_test_1.patch | 1.78 KB | kscheirer |
| #15 | 296326_l_class_test_0.patch | 1.92 KB | kscheirer |
Comments
Comment #1
nagba commentedAdded 2 tests which are testing the active class being added, and the class specified in the $options array being added.
(tthbonnier, nagba)
Comment #2
webchickComment #4
dries commentedComment #5
dawehnerrerole of the test, with the right root path, with a little more documentation
Comment #6
dawehnerComment #7
catchFew minor issues:
- we don't have phpdoc for getInfo()
- doesnt needs an apostrophe (or maybe use $this->randomName() instead)
- The references to l should probably be l() to make it easier to spot it's a function when scanning through.
Comment #8
dawehnerthx for the review
i was not sure what you meant with "doesn't needs an apastrophe but i think you meant the link title
i also added a line wrap, because i think its much better to read
Comment #10
dawehnerrerolled this patch, thx testbot
Comment #12
dawehnerI'm still wondering what you mean with this
here is a rerole of this patch
Comment #13
kscheireris there a better way to check for an applied class? Using
$this->assertEqual()seems to rely a little too heavily on the format of a link never changing. Maybe a check via regular expression instead?Comment #14
kscheirerComment #15
kscheirerok, I guess since I complained I should find a better way. I used a preg_match() to check that the class is added to the link, so we're not checking against the specific structure of a link tag anymore. Also updated the patch against the latest HEAD.
Comment #17
kscheirerresetting for testbot
Comment #19
kscheirerrerolled against HEAD
Comment #21
kscheirerrerolled against HEAD, there were changes introduced in #310139: drupal_query_string_encode() should not call drupal_urlencode(). Also fixed spacing issues with testDrupalQueryStringEncode().
Comment #23
kscheirerrerolled against HEAD, also removed some extra spaces that were introduced in #296324: TestingParty08: url() for internal urls need a thorough test (sorry).
Comment #25
kscheirerhmm, patch still applies without fuzz for me. resetting for testbot.
Comment #27
cburschkaThis patch was tested before detailed failure messages were added. Re-testing.
Comment #29
mr.baileysRerolled the patch so it applies to HEAD again. Also, since #326539: Convert 'class' attribute to use an array, not a string landed, class attrributes are now arrays instead of strings.
Added an additional test (see OP) to verify that the active class is also added when a custom class is present.
Comment #30
sun.core commentedSorry, but tests don't qualify as critical anymore.
Comment #31
acouch commentedThis test passed.
Comment #32
dries commentedCommitted to CVS HEAD. Thanks.