? ? Failure

User tests: Successful: Unsuccessful:

avatar wilsonge
wilsonge
4 Aug 2014

OK So unit testing for plugins it turns out is easily doable

Now I need some ideas on how to test the email cloaking plugin (which currently is the bane of our lives) as of course it's designed not to be detectable my bots! Ideas anyone?

Currently tests are failing because I've added in JM's test examples and not bothered to add the correct expected results - just so people can experiment and look at what I've done.

avatar wilsonge wilsonge - open - 4 Aug 2014
avatar jissues-bot jissues-bot - change - 4 Aug 2014
Labels Added: ? ?
avatar wilsonge wilsonge - change - 4 Aug 2014
The description was changed
Description <p>OK So unit testing for plugins it turns out is easily doable</p> <p>Now I need some ideas on how to test the email cloaking plugin (which currently is the bane of our lives) as of course it's designed not to be detectable my bots! Ideas anyone?</p> <p>Currently tests are failing because I've added in JM's test examples and not bothered to add the correct expected results - just so people can experiment and look at what I've done.</p>
avatar brianteeman brianteeman - change - 5 Aug 2014
Labels Added: ?
avatar nicksavov nicksavov - change - 21 Aug 2014
Labels Removed: ?
avatar brianteeman brianteeman - change - 21 Aug 2014
Status New Pending
avatar brianteeman brianteeman - change - 2 Sep 2014
Category Unit Tests
avatar mbabker
mbabker - comment - 29 Sep 2014

Care to work on this some more that way we might be able to merge it in?

avatar wilsonge
wilsonge - comment - 29 Sep 2014

I'd love to work on it more. But I'm really struggling for how to unit test a random number :(

avatar javigomez javigomez - assigned - 16 Oct 14
avatar nicksavov nicksavov - change - 16 Oct 2014
Labels Added: ?
avatar brianteeman brianteeman - change - 1 Jan 2015
Labels Removed: ?
avatar Hackwar
Hackwar - comment - 3 Feb 2015

Can you update this PR to latest staging and solve the merge conflicts? Maybe we can work on this together in the near future and solve the test issues.

avatar roland-d
roland-d - comment - 20 Aug 2015

Hello @wilsonge

Thank you for your contribution.

The last comment here was on 3rd February. So the question is, Is this issue/pull request still valid?
If no reply is received within 4 weeks we will close this issue.

Thanks for understanding!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4071.

avatar wilsonge
wilsonge - comment - 20 Aug 2015

Yes this is definitely still valid

avatar roland-d
roland-d - comment - 20 Aug 2015

@wilsonge So this is still valid but no way to test it and merge it?

avatar mbabker
mbabker - comment - 20 Aug 2015

Once that CLI specific thing comes out (which is a bad hack for the unit tests to always have a known value, changing the behavior of what's being tested ironically) there is no human testing involved in this one; it's all unit test changes (so ensure CI passes and code review).

avatar wilsonge
wilsonge - comment - 20 Aug 2015

So how do we deal with random numbers. I can't predict a random number as the unit test outcome :P

avatar mbabker
mbabker - comment - 20 Aug 2015

Assert the string contains a stretch of text around it, or come up with some kind of regex to assert that the string is built correctly with a number that's in the valid range defined by the randomizer. Altering the behavior of a method when you're testing it is probably worse than not testing the thing. Plus, this should only be testing what the plugin method does, not what the JHtml helper is doing too (but since it's all static, it can't be mocked, oh how I love the CMS environment sometimes...).

avatar mbabker
mbabker - comment - 20 Aug 2015

I don't know if I should laugh at how hysterical the notion of overriding JHtml calls with its API for testing is or cry because that's a necessity.

avatar zero-24
zero-24 - comment - 23 Aug 2015

@wilsonge can you fix the merge conflicts? Than we can see what the unit test say about your code ;)

avatar roland-d
roland-d - comment - 8 Nov 2015

Hello @wilsonge

Thank you for your contribution.

The last comment here was on 23rd August. Are you planning to work on this any time soon? If not, please close and re-open when you plan to work on it.

If no reply is received within 4 weeks we will close this issue.

Thanks for understanding!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4071.

avatar roland-d roland-d - change - 8 Nov 2015
Status Pending Information Required
Labels
avatar brianteeman brianteeman - change - 17 Dec 2015
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2015-12-17 11:11:52
Closed_By brianteeman
Labels
avatar brianteeman brianteeman - change - 17 Dec 2015
Labels
avatar brianteeman brianteeman - close - 17 Dec 2015
avatar brianteeman
brianteeman - comment - 17 Dec 2015

Closed due to lack of response for further information - it can always be reopened if that is provided


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4071.

Add a Comment

Login with GitHub to post a comment