Closed (fixed)
Project:
Drupal core
Version:
8.2.x-dev
Component:
file system
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Aug 2016 at 21:08 UTC
Updated:
17 Oct 2016 at 13:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
klausiYes please! Some minor stuff:
We don't want to create new test related files in the src/Tests folder of a module because this is the old deprecated Simpletest location. Any test related stuff should be in tests/src.
visibility of the function is missing, I think this should be "protected", right?
I'm not happy that we create new stuff in the deprecated simpletest module, but since it calls simpletest_*() functions I guess this is ok for now.
Comment #3
samuel.mortensonAddressed notes from #2.
Comment #5
samuel.mortensonRe-roll.
Comment #6
catchComment #7
dawehnerThis issue contains some bits from #2738567: Add test trait for drupalGetTestFiles and drupalCompareFile, so we maybe should postpone it for now?
Comment #8
samuel.mortensonThere will probably be collisions with that issue as #2421427: Improve the UX of Quick Editing single-valued image fields is RTBC'd now, and includes this change.
Comment #9
dawehner@samuel.mortenson
Do you mind rerolling your patch with the trait from the other issue?
Comment #10
samuel.mortensonSure, I can do that and update the issue references.
Comment #11
samuel.mortensonActually the "ImageFieldCreationTrait" doesn't exist in that other issue, so it's not as easy as re-rolling the Quick Edit UX issue to use #2738567: Add test trait for drupalGetTestFiles and drupalCompareFile. What's the best way to proceed here?
Comment #12
dawehnerWell, apply the other patch locally and try to write the ImageFieldCreationTrait on top of it :)
Comment #13
samuel.mortensonDone, sorry for the delay. I'm closing this as a duplicate and updating the Quick Edit Image issue.
Comment #14
samuel.mortensonMoving back to Needs work, as the "ImageFieldCreationTrait" isn't covered by the other issue. When #2738567: Add test trait for drupalGetTestFiles and drupalCompareFile is committed, I'll re-roll the patch to only include that trait and move the issue back to Needs review.
Comment #15
samuel.mortensonRe-roll to only include the trait not already added in #2738567: Add test trait for drupalGetTestFiles and drupalCompareFile.
Comment #16
samuel.mortensonComment #17
martin107 commentedThe idea behind the issue is good.
Patch is clean. in that it does what is stated and nothing else.
Comment #19
martin107 commentedMy mistake
Trait 'Drupal\image\Tests\ImageFieldCreationTrait' not found in /var/www/html/core/modules/image/src/Tests/ImageFieldTestBase.php on line 25
I will fix this up.
Comment #20
samuel.mortensonThanks @martin107! I'll leave it to you.
Comment #21
martin107 commented@samuel.mortenson - Ah you are welcome.
My preferred home in the namespace tree was
1. Drupal\Tests\image\ImageFieldCreationTrait
2. Drupal\Tests\image\Traits\ImageFieldCreationTrait
but the PSR autoloader does not seems to be that flexible.
So I went with the next best
Drupal\Tests\image\Kernel\ImageFieldCreationTrait
If anyone has better suggestions ... my solution seems like a cludge!
Comment #22
dawehnerWell, maybe we should add an issue about it?
Comment #23
dawehnerBeside from that though, this looks pretty nice
Comment #24
dawehnerI'm wondering whether we should have dedicated tests for this new trait.
Comment #25
martin107 commentedI have opened a side issue for a better home for the trait.
Comment #26
martin107 commentedA minor nudge added an optional prefix to some @params in the new trait
Comment #27
dawehnerThank you @martin107
Comment #28
wim leersThis blocks #2421427: Improve the UX of Quick Editing single-valued image fields.
Comment #29
alexpottAs a simple code move in tests this is rc eligible. Committed and pushed 66741e3 to 8.3.x and 18da006 to 8.2.x. Thanks!