In the SimpleTest library they have depreciated assertWantedText moving towards assertText which is what most, if not all, of the tests use anyway. I'm proposing that we remove assertWanted... methods like that and assertWantedRaw in favor of assertRaw.

When I get time I will create a patch, otherwise anyone else can feel free.

Any comments on this would be great.

#4 refactorST.patch67.81 KBRok Žlender


dlangevin’s picture

Might it be better to just have assertWanted... methods call assert... methods instead? That way tests written using the old syntax will still pass.

boombatower’s picture

That is definitely a possibility.

My main reasoning is to make the test consistent and easier to read since the two methods to the exact same thing. To fix it will be a simple find and replace and ensure that the tests still work.

The only function that will have an issues I believe is assertWantedRaw since there is no assertRaw counterpart currently in DrupalTestCase. But still only find and replace.

There are three older tests that currently use assertWantedText, but all others don't.

So this is not final, just throwing the idea out there.

webchick’s picture

+1 for s/assertWantedRaw/assertRaw/g; to mirror SimpleTest's non-deprecated function names.

Rok Žlender’s picture

Status: Active » Needs review
67.81 KB

Patch changes asertWantedRaw to assertRaw and assertNoUnWantedRaw to assertNoRaw I also removed assertWantedText and assertNoUnwantedTest. I hope I got all changes in test files.

boombatower’s picture

Status: Needs review » Fixed


I tested it on a few of the tests that I know work and they seemed fine. Had a few merging issues since the HEAD changes frequently, but I fixed those.

Since I am reviewing all tests and making sure they pass I should catch any unwanted side effects of this.


Anonymous’s picture

Status: Fixed » Closed (fixed)

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