Closed (fixed)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Flag core
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 Jun 2015 at 23:35 UTC
Updated:
25 Aug 2015 at 21:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
socketwench commentedComment #2
socketwench commentedWIP patch.
Comment #3
socketwench commentedNot quite sure why Flag::load() doesn't work in FlagTestBase...
Comment #4
joachim commentedLooking like a good start!
Surplus blank line.
Should be '(optional)'.
Also, I'm not entirely sure about special-casing node here. Smells a bit D6! ;)
Let's say 'flag entity' to be clear.
It's best to have a sanity-checking assertion here, so in case something disastrous goes wrong, we can see where the problem is.
Needs a bit of a tidy-up...
Aren't add and edit different forms now? And here we're only ever creating.
Doesn't most of our module code assume that the plugin ID and the entity type ID are identical? I should check that...
Do we need this?
This could be inlined as array_keys(entity_get_bundles()).
Comment #5
socketwench commentedFigured out that there was some parameter name duplication in FlagTestBase::grantFlagPermissions() and integrated most of the suggested changes.
Comment #6
socketwench commentedYeah... The thing is we do test mostly nodes right now.
That's a good idea. I added some instanceof asserts to the test base.
They always were different classes, but we also have an "add page" so saying "add form" is ambiguous. I changed it to "details form".
I blame the terrible movie I was watching at the time.
Comment #7
martin107 commentedNow where is my copy of Flash Gordon ... I haven't see that terrible movie in a long time.
Oh wait is was hiding behind the film of George Clooney driving the batman franchise into a hole for a decade....
Nothing of any significance, swept some coding standard errors out of FlagTestBase.php
Plus now using $this->t() in preference over pulling t() from global state...
will try and find time from a proper review tomorrow.
Comment #8
joachim commented> Yeah... The thing is we do test mostly nodes right now.
Yes, I know -- I'm feeling conflicted about the special-casing, as I can see a case for it too! :/
Comment #9
socketwench commentedDid some refactoring of FlagCountsTest to verify that FlagTestBase::createFlag() worked.
Comment #10
socketwench commentedIn the interest of getting this into the repo, I suggest we refactor any further tests in other issues.
Comment #11
martin107 commentedThe patch looks like a good refinement to me to so +1
one minor quibble
The name createFlagForm() fools me into thinking its job is to create a form.
So I have change it to createFlagViaForm --
naming things is hard ... sorry if I am treading on anyone's toes...
Comment #12
joachim commented> The name createFlagForm() fools me into thinking its job is to create a form.
Seems like a good idea to me. I can't speak for socketwench's toes of course, but were it me, my toes would be feeling unharmed and, indeed, appreciative of the input :)
Comment #13
socketwench commentedYeah, I was thinking that method needed a "From" in there somewhere. createFlagFromForm() seems like a good idea. "Via" would work too, although I'd be concerned about non-english speakers since via is a less common word.
Comment #14
martin107 commentedDyslexics of the world, Untie!
createFlagFromForm() - there is letter order issue for dyslexics that might misread it as a repeated word.
Via - That issue also occurred to me, so if two people have spotted it then it is out.
How about
createFlagByForm()
createFlagWithForm()
?
Comment #15
socketwench commentedcreateFlagByForm() is shortest. ^_^
Comment #16
joachim commentedWe're officially bikeshedding now... ;)
I prefer createFlagWithForm. 'by form' sounds oddly formal, like trial by combat or something.
Here's what I hope is a final nitpick:
Wrapping needs fixing here.
This is a change from the previous functionality, and I'm really not keen on these being completely random, because it will make debugging tests harder. When you look at the pages seen by a test, you won't be able to tell whether a link is for flagging or unflagging. So can we have them as 'Flag this item' instead?
'all bundles... is'?
Also, could this be reworded so it doesn't use the 2nd person?
Needs to say the default is 'node'.
Also, I still think we don't need getBundleIds().
Comment #17
socketwench commentedComment #18
joachim commentedUgh, this has rotted. I'll try and reroll.
Comment #19
joachim commentedReroll, with in addition the disabling of strict config checking removed in the new base class, as that's been removed everywhere else since the patch in #17 was posted.
If the testbot likes this I'll commit.
Comment #20
martin107 commentedpicked out 2 small nits.
Comment #22
joachim commentedThanks!