Closed (fixed)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Flag core
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
6 Oct 2015 at 14:18 UTC
Updated:
26 Oct 2015 at 19:14 UTC
Jump to comment: Most recent, Most recent file
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | 2581187-32.flag_.new-admin-ui-test.patch | 24.2 KB | joachim |
| #30 | 2581187-30.flag_.new-admin-ui-test.patch | 23.49 KB | joachim |
| #28 | 2581187-28.flag_.new-admin-ui-test.patch | 24.47 KB | joachim |
| #25 | 2581187-25.flag_.new-admin-ui-test.patch | 23.58 KB | joachim |
| #17 | 2581187-17.flag_.new-admin-ui-test.patch | 23.5 KB | joachim |
Comments
Comment #2
joachim commentedBig patch, but I've done it as a sequence of commits so that makes it clearer to see what's going on.
Here's the subjects of each commit by way of a summary:
Comment #3
martin107 commented@joachim, please forgive me if this is treading on your toes... feel free to ignore this patch
I think your changes are an improvement \Drupal\flag\Tests\AdminUI is the way to go...
before helping out on this I want to make a patch that clears a few things up.
I have cleared what I think is a bug in AdminUI::setup()
$node was undefined when used.
The changes are minor nits only
1) I ran the new test through phpcs and fixed a couple of things.
2) \Drupal\flag\Tests\AdminUI::id - I've changed the name to flagId as I wanted a clear separation from AdminUI::nodeId
3) FlagTestBase makes $this->t() available so I have swapped out uses of t() - which will sometime in the future become deprecated.
running the tests locally fails, but then there are a few todo to resolve.
Comment #10
socketwench commentedSame changes as Martin, getting the following error:
Comment #11
martin107 commentedJust fixing some nits - nothing to bring the error count down.
Comment #14
joachim commentedCool, thanks guys! I'll work on this more tonight.
> 3) FlagTestBase makes $this->t() available so I have swapped out uses of t() - which will sometime in the future become deprecated.
I'm going to leave this one out -- my aim here is for a patch that moves code around as near as possible, so we can see that no test coverage has been lost. Replacing t() calls can be done later.
Comment #16
joachim commentedI don't think we need that -- we're already in that namespace.
Don't need to change the import statements here -- we're killing this class.
Comment #17
joachim commentedComment #20
joachim commented> Warning: Missing argument 4 for flag_flag_access() in flag_flag_access() (line 246 of modules/contrib/flag/flag.module).
This seems to be a new problem caused by a change in core.
Comment #21
berdirYes.
http://drupal.org/node/2581447
However, that whole function looks weird anyway. It conflicts with hook_ENTITY_TYPE_access() and is most of the time called with completely different arguments. This only worked accidently because they didn't have directly conflicting type hints.
Comment #22
joachim commentedI've filed it here: #2584299: hook_flag_access() clashes with hook_ENTITY_TYPE_access().
> However, that whole function looks weird anyway.
Yup. And none of the flag code invokes it! So all the 'flag only your own node' access code never gets touched.
Comment #25
joachim commentedFailing tests were due to this in createFlagWithForm():
If you do the submit yourself and don't specify flag_short/flag_long, you get the form's defaults. But if you use createFlagWithForm() and don't specify them, you get createFlagWithForm()'s defaults. I think this is weird! Filed #2585405: createFlagWithForm() shouldn't provide defaults that are different from the actual edit form's defaults.
Comment #28
joachim commentedWhoops! Forgot this bit.
(BTW: I've turned off one of the test environments, as getting TWO fail comments was getting a bit tedious. I reckon we only need PHP 5.6 for issue testing. On the other hand, I've enabled PHP 7 and also PostGres for daily branch testing. This new d.org CI is ace!)
Comment #30
joachim commentedComment #32
joachim commentedArgh! permissions weren't getting set.
Comment #33
joachim commentedAhhhhhh... FINALLY! :D
Comment #34
socketwench commentedLooks good.
Comment #39
joachim commentedThanks for the review!