Closed (fixed)
Project:
Feeds
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Apr 2018 at 13:49 UTC
Updated:
11 May 2018 at 06:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
anybodyComment #3
anybodyComment #4
anybodyDoesn't have configuration options, so I removed the interface.
Comment #6
anybodyComment #7
anybodyWorks well, we're using it already. Please test and review to commit this as soon as possible :)
Comment #8
megachrizThanks for providing a patch for this!
I'm not so sure about cutting off the string if it is too long. You would be throwing away user input without notification. Even worse: it may result into an incomplete telephone number (I also noticed that you reference the Unicode class, but you didn't "import" that class at the top of the file).
Would you like to add an unit test for this target as well?
Comment #9
anybodyThank you very much, I'll check that. I thought Telephone behaves like a regular String field with 255 maxlength varchar, but I'm not sure and have a look. If that's not the case I'll remove the limit and create a new patch.
Comment #10
anybodyPS: Yes of course I'm willing to add a test, can you tell me where I can find some example implementation which fits best? That would help a lot and speed things up.
Comment #11
megachriz@Anybody
Other tests for targets can be found in feeds/tests/src/Unit/Feeds/Target. Which of these would be the most similar? EmailTest perhaps?
Comment #12
anybodyHere we go. You're right, I've removed the cutoff and I added some tests as required. Please review.
Thank you very much. The module is so great!!
Comment #13
anybodyComment #14
anybodySorry I forgot to add the Tests to the patch. Attached now!
Comment #15
megachrizThe name of the class is wrong, apparently resulting into the test being ignored by the testbot.
No dollar sign for variable 'values'.
In the attached patch I've rewritten the test with a data provider. As I think randomness should be avoided in tests (as they can cause random test failures), I left these parts of the tests out.
Comment #17
megachrizReferenced the right class in the test and a few coding standard fixes.
Comment #18
anybodyThank you MegaChriz, still a lot to learn. I hope I'll do better next time!
Comment #20
megachriz@Anybody
You bet! ;)
Committed #17.