Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm kind of amazed there isn't already an issue for this but there seems not to be.
From the bottom of profile.test:
/**
* TODO:
* - Test field visibility
* - Test profile browsing
* - Test required fields
* - Test fields on registration form
* - Test updating fields
*/
Comment | File | Size | Author |
---|---|---|---|
#23 | profiletest.patch | 10.08 KB | bleen |
#19 | profiletest_2.patch | 10.08 KB | bleen |
#14 | profiletest.patch | 10.18 KB | bleen |
#13 | profile.test | 22.61 KB | craigmc |
#10 | add_profile_field_update_tests.patch | 8.42 KB | craigmc |
Comments
Comment #1
catchMoving this out of the critical bugs queue - see #607038: Meta issue: fix gaps in code coverage.
Comment #2
sreynen CreditAttribution: sreynen commentedI added tests for field visibility, required fields, and fields on registration form. Looks like someone else already did profile browsing. The only one left is "Test updating fields," which I didn't do because I'm not sure what should be tested on that beyond the existing updateProfileField(). Maybe that's already done and just wasn't removed from the list?
Comment #3
craigmc CreditAttribution: craigmc commentedRedacted
Comment #4
craigmc CreditAttribution: craigmc commentedComment #5
bleen CreditAttribution: bleen commentedYou dont need "$content =" it can just be "$this->drupalGet..."
white space
I think we need to check through the other possible visibility settings (aren't there 3 or 4?)
Here are a few quick notes ... still looking at the patch in #2
Powered by Dreditor.
Comment #6
bleen CreditAttribution: bleen commentedThis still needs to be done ... I think the intent here is to test that I can create a profile field called "favorite color" and then later on change the filed to be "Most Awesomest Color Ever"
Current tests only test that if an end-user changes favorite color from "red" to "blue" that it works
Powered by Dreditor.
Comment #7
craigmc CreditAttribution: craigmc commentedGoing through code comments, "updating field" test, and remaining visibility settings.
Comment #8
craigmc CreditAttribution: craigmc commentedAdded tests for all visibility permutations. Incorporated comments from #5.
#6 still needs to be implemented.
Comment #9
craigmc CreditAttribution: craigmc commentedMore time for sprint! adding Update field test case
Comment #10
craigmc CreditAttribution: craigmc commentedComment #11
bleen CreditAttribution: bleen commentedcraigmc: when creating a patch you need to use -up (ex: cvs diff -up >path/to/file.patch)
Comment #13
craigmc CreditAttribution: craigmc commented@bleen18 Sadly my computer seems to be the one that can't hang with the Drupal 7 CVS distro. Will post the full file so you can do the diff yrself. Working on getting it sorted out.
Comment #14
bleen CreditAttribution: bleen commentedthis is the patch that includes craigmc's changes ... I haven't looked through it yet,
Comment #15
bleen CreditAttribution: bleen commentedstatus
Comment #17
craigmc CreditAttribution: craigmc commentedFYI-- the reason this patch is not passing testing is related to the issue I posted here http://drupal.org/node/774866
If a Field is set to Hidden, it does not appear on the user/uid page when viewed by an administrator, only on the user/uid/edit page. Currently, my test code tests for what I understand the functionality to mean, where the field is/should be viewable by an admin. Requires a refinement of the requirement and/or description before we can complete this.
BTW managed to address build issue so will be able to create grown-up patches. thx for the assist bleen18
Comment #18
bleen CreditAttribution: bleen commentedI'm playing with these errors (and white space formatting issues)
Comment #19
bleen CreditAttribution: bleen commentedOk ... this patch shows several errors and several warnings... I believe that the tests are correct, but that they are revealing a few problems. I need someone to confirm though:
Here is the warning that appears on /profile after a new field has been added:
"Strict warning: Creating default object from empty value in template_preprocess_profile_listing() (line 573 of /.../d7/modules/profile/profile.module)."
The error is a bit trickier... I'm not sure if its an error or if its expected behavior. When a new field is added to profiles, should that new field show up in the list when you go to /profile? If so then these errors are actual errors ... if not, then the tests need to change.
Anyone know?
For now I am making this critical since we are getting a PHP warning... once we figure this out, we can put it back to normal
Comment #20
sreynen CreditAttribution: sreynen commentedIf the test demonstrates an actual error, that error should be in a separate issue to keep issues focused. I'm pretty sure tests are never considered critical issues, so changing that priority.
Comment #21
bleen CreditAttribution: bleen commentedI have created an issue and submitted patch at #776936: PHP Warning when viewing /profile after adding field... once that lands, we can keep going on these tests
Comment #22
gowriabhaya CreditAttribution: gowriabhaya commentedCode sprint tag
Comment #23
bleen CreditAttribution: bleen commentedreuploading the patch from #19 to see what testbot has to say