Support from Acquia helps fund testing for Drupal Acquia logo

Comments

premgangwar’s picture

Assigned: Unassigned » premgangwar
Anonymous’s picture

I added the test to check the presence of name and email field for anonymous user in the same test

andypost’s picture

Status: Active » Needs review
Grimreaper’s picture

Status: Needs review » Reviewed & tested by the community

Hello,

I just test the patch and it is OK.

I saw in the debug message, the case authenticated and the case authenticated and the results are the same as the results browsing the sites.

Is there any other thing that need testing ?

andypost’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactAuthenticatedUserTest.php
    @@ -24,13 +24,14 @@ class ContactAuthenticatedUserTest extends WebTestBase {
    -   * Tests that name and email fields are not present for authenticated users.
    +   * Tests that name and email fields are not present for authenticated users
    +   * and present for anonymous users
    

    Should be "One-line summary, ending in a period (.)"
    See https://drupal.org/node/1354#order
    and https://drupal.org/node/325974

  2. +++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactAuthenticatedUserTest.php
    @@ -41,5 +42,17 @@ function testContactSiteWideTextfieldsLoggedInTestCase() {
    +    $this->assertTrue($this->xpath('//input[@name=:name]', array(':name' => 'mail')));
    +    ¶
    

    trailing white-space, and unneeded line

  3. +++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactAuthenticatedUserTest.php
    @@ -41,5 +42,17 @@ function testContactSiteWideTextfieldsLoggedInTestCase() {
       }
     }
    

    "Leave an empty line between end of method and end of class definition" see https://drupal.org/node/608152

Grimreaper’s picture

Status: Needs work » Needs review
FileSize
1.92 KB

I remade the patch of comment #2. Is it good now ?

@andypost : on the documentation pages you mentionned, is there a problem ? Because I read "leave empty line ...." and in the exemples I don't see empty lines.

Anonymous’s picture

I generated a new patch taking care of the coding style

Anonymous’s picture

Changed the summary to one line summary
Removed empty space
One line between end of method and end of class definition

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Awesome!
@Grimreaper hm, that should be fixed, please edit this page

Grimreaper’s picture

@andypost : ok, I see, when I edit the documentation page, there are blank lines which are removed when seeing the page : https://drupal.org/node/325974

What should be fixed this issue or the documentation page?

andypost’s picture

@Grimreaper Suppose you mean https://drupal.org/node/608152#indenting that's a really bug!

andypost’s picture

karan.poddar’s picture

Applied the patch and it works perfect.

Status: Reviewed & tested by the community » Needs work
visabhishek’s picture

Status: Needs work » Needs review
andypost’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Not 100% sure that adding this to a test method called testContactSiteWideTextfieldsLoggedInTestCase in a file called ContactAuthenticatedUserTest makes sense. Plus the name and email fields are tested every time ContactSitewideTest::submitContact() is called when using the anon user. If we want to add the assertion for the fields let's add it to ContactSitewideTest::testSiteWideContact() when it's is using the anon user.

leevingo’s picture

Status: Needs work » Needs review
Issue tags: +DUGBE1409
FileSize
2.84 KB

Moved the test to ContactSitewideTest::testSiteWideContact() and removed ContactAuthenticatedUserTest.php.

Status: Needs review » Needs work
leevingo’s picture

Status: Needs work » Needs review
FileSize
2.8 KB

Updated the patch that failed testing.

subhojit777’s picture

Assigned: premgangwar » Unassigned

Status: Needs review » Needs work
subhojit777’s picture

Assigned: Unassigned » subhojit777
Issue tags: +Needs reroll
subhojit777’s picture

Assigned: subhojit777 » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.79 KB

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Mile23’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Generally looks good but needs a re-roll. We can leave this at 8.1.x since it only changes tests.

kostyashupenko’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
1.6 KB

Reroll of #25.
ContactAuthenticatedUserTest.php was removed in 8.1.x

andypost’s picture

+++ b/core/modules/contact/src/Tests/ContactSitewideTest.php
@@ -42,7 +42,28 @@ protected function setUp() {
+    // Now Ensure that there is textfield for name.
...
+    // Now Ensure that there is textfield for email.

Please remove "Now" or s/Ensure/ensure

poojasharmaece’s picture

Patch updated as per #29

Status: Needs review » Needs work

The last submitted patch, 30: extend-2212869-1.patch, failed testing.

kellyimagined’s picture

Status: Needs work » Needs review
FileSize
1.6 KB

Updated patch for case in #29

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

ZeiP’s picture

Re-roll against 8.3.x. IMO the comment changes in patch 30 were better, so I re-rolled that one.

jibran’s picture

Test looks good but do we need ContactAuthenticatedUserTest after this?

naveenvalecha’s picture

#36,
Nice question Jibran. We don't need that as we are testing the same stuff in testSiteWideContact. We could easily remove that class as that's not a base class and there wouldn't be any BC problem of removing it.

//Naveen

jibran’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

  • catch committed 0e005bb on 8.4.x
    Issue #2212869 by hellboy2k8, leevingo, naveenvalecha, Grimreaper,...
catch’s picture

Version: 8.3.x-dev » 8.4.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.4.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.