Call l for the current page with and without a class set in $options and assert that the active class is properly added.

Comments

nagba’s picture

StatusFileSize
new1.39 KB

Added 2 tests which are testing the active class being added, and the class specified in the $options array being added.
(tthbonnier, nagba)

webchick’s picture

Status: Active » Needs review

Patch failed to apply. More information can be found at http://testing.drupal.org/node/13894. If you need help with creating patches please look at http://drupal.org/patch/create

dries’s picture

Status: Needs review » Needs work
dawehner’s picture

StatusFileSize
new1.84 KB

rerole of the test, with the right root path, with a little more documentation

dawehner’s picture

Status: Needs work » Needs review
catch’s picture

Component: tests » base system
Status: Needs review » Needs work
Issue tags: +Needs tests

Few 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.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new1.68 KB

thx 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

Status: Needs review » Needs work

The last submitted patch failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new1.93 KB

rerolled this patch, thx testbot

Status: Needs review » Needs work

The last submitted patch failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new2.1 KB

- The references to l should probably be l() to make it easier to spot it's a function when scanning through.

I'm still wondering what you mean with this

here is a rerole of this patch

kscheirer’s picture

is 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?

kscheirer’s picture

Status: Needs review » Needs work
kscheirer’s picture

Assigned: Unassigned » kscheirer
Status: Needs work » Needs review
StatusFileSize
new1.92 KB

ok, 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.

Status: Needs review » Needs work

The last submitted patch failed testing.

kscheirer’s picture

Status: Needs work » Needs review

resetting for testbot

Status: Needs review » Needs work

The last submitted patch failed testing.

kscheirer’s picture

Status: Needs work » Needs review
StatusFileSize
new1.78 KB

rerolled against HEAD

Status: Needs review » Needs work

The last submitted patch failed testing.

kscheirer’s picture

Status: Needs work » Needs review
StatusFileSize
new2.67 KB

rerolled against HEAD, there were changes introduced in #310139: drupal_query_string_encode() should not call drupal_urlencode(). Also fixed spacing issues with testDrupalQueryStringEncode().

Status: Needs review » Needs work

The last submitted patch failed testing.

kscheirer’s picture

Status: Needs work » Needs review
StatusFileSize
new5.48 KB

rerolled against HEAD, also removed some extra spaces that were introduced in #296324: TestingParty08: url() for internal urls need a thorough test (sorry).

Status: Needs review » Needs work

The last submitted patch failed testing.

kscheirer’s picture

Status: Needs work » Needs review

hmm, patch still applies without fuzz for me. resetting for testbot.

Re-test of 296326_l_class_test_3.patch from comment #23 was requested by Arancaytar.

cburschka’s picture

This patch was tested before detailed failure messages were added. Re-testing.

Status: Needs review » Needs work

The last submitted patch, 296326_l_class_test_3.patch, failed testing.

mr.baileys’s picture

Assigned: kscheirer » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.5 KB

Rerolled 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.

sun.core’s picture

Priority: Critical » Normal

Sorry, but tests don't qualify as critical anymore.

acouch’s picture

Status: Needs review » Reviewed & tested by the community

This test passed.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Needs tests

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