Delivered-To: garrett@eclipse3sixty.com Received: by 2002:a6b:b603:0:0:0:0:0 with SMTP id g3-v6csp444857iof; Tue, 7 Aug 2018 23:00:42 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxax5hssIZCpNTijbi+jTsGdVkLYqtqIJLSmMmugyI2ZKOvWI1DamHEnDp8abOmrVdX9Ip1 X-Received: by 2002:a24:5242:: with SMTP id d63-v6mr1133745itb.138.1533708042758; Tue, 07 Aug 2018 23:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533708042; cv=none; d=google.com; s=arc-20160816; b=DwYKd9JPWBVkAtq+BeibGRYxU264t5OtioR+dfS3YgKIHW42aNHM8huQHz304Q47ni 8yp5S6QfXsf5LPSoSQ5mLEELoNcU+Lueu9+ubwz2suOV0rLIaftd4xIrMOd6iGyCES+2 qd1/a0oDkxELzpA6QhTR0pF7QdIid/t+H++tg7oJ4Q6pyLQGwz/0QIvDzidwDHaonZb+ r8uqMAdaigagLAwWx3yr8FBRBYo3nFc7cdDOpGaAXTyJdBLFOPi0LcRoc0Uc4aY3uHI1 07t9CL/eYV9HHFlvC0E7ydUn3b2KJKvUMPWgqLABtom/p8ep72QANWW7TNFa14rBlXfq nQ6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:message-id:reply-to:date:in-reply-to:references:to :auto-submitted:cc:precedence:from:mime-version:domainkey-signature :dkim-signature:arc-authentication-results; bh=Lt9mQRb8hJztmQwsHscgQugHeAWEMjXRHW8naW3AChM=; b=abOPOodygUP56U20hxpgQYWpugat2z5e6rvrMpEnjQ/yEYCS3TU96zdcTk3NLnxFrn KWd5wuNQ+fJqWvQgDAOETjlIfRhPffyRt6qVLZqGJVfnNbIUNKt9XTR8V3RSIFK2QQql f3evwsAnMVRmF+O6FDVbxm0wwrBFxfIBPTA5vVD0FfNcAr7sUv1n3+clvsksR5y6N/sJ WPHU6wb7/E5dGM5xU9obF1Wu8JKGROCmoAt7LsK6p7jP6zX1mPxO0KilbjUaMDpfwj9/ H3rL4RahIIGA0LglvmzmIoJnf1wbxDzT2sAB1MSJSMceH4al9t6ABLoUJOoUoDFc0cON RFhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wordpress.org header.s=wp1 header.b="W8e/NYsh"; spf=pass (google.com: domain of noreply@wordpress.org designates 198.143.164.146 as permitted sender) smtp.mailfrom=noreply@wordpress.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wordpress.org Return-Path: Received: from mail.wordpress.org (smtp1.ord.wordpress.org. [198.143.164.146]) by mx.google.com with ESMTPS id g9-v6si2276333ioa.15.2018.08.07.23.00.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Aug 2018 23:00:42 -0700 (PDT) Received-SPF: pass (google.com: domain of noreply@wordpress.org designates 198.143.164.146 as permitted sender) client-ip=198.143.164.146; Authentication-Results: mx.google.com; dkim=pass header.i=@wordpress.org header.s=wp1 header.b="W8e/NYsh"; spf=pass (google.com: domain of noreply@wordpress.org designates 198.143.164.146 as permitted sender) smtp.mailfrom=noreply@wordpress.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wordpress.org Received: from mail.wordpress.org (localhost.localdomain [127.0.0.1]) by mail.wordpress.org (Postfix) with ESMTP id 2323421A70; Wed, 8 Aug 2018 06:00:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=wordpress.org; h= content-type:mime-version:from:cc:to:references:in-reply-to:date :reply-to:message-id:subject; s=wp1; bh=+Mkc3YpgGZD8PI4EACseNN4p lsI=; b=W8e/NYshn6xe7y3GJOXoK0lke7pnTcr00cEby4BJsspANTfETAxUizrY GcCblU+kvgtNMT/C5P+JwfcztITQQHpCTPSXkN1LTfVtai0W1V3Bfmd5cdCD7NEJ rO410bQ8p1v6qtqoO3Mg4XzXxCfXfUYDSNFeZk3BCq7Xmxb7aJQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=wordpress.org; h= content-type:mime-version:from:cc:to:references:in-reply-to:date :reply-to:message-id:subject; q=dns; s=wp1; b=p8IDCJKVyB0zQOMI+i lnyYWgQjA9zqcnKytSRX8EoS+hudU+I506xFggSFakU5nqpHz36uo69DZL1NKCme XIH51XPqAvUd6lbA2i19CNlkHCmrV/gP+4RPPkCajuG81g1ysO8U+wkADXSb2Vgg fBr62Hv07li7cl0ZNtryRfSKc= Content-Type: multipart/related; boundary="===============8026228139510718423==" MIME-Version: 1.0 X-Trac-Realm: ticket From: "WordPress Trac" X-Trac-Version: 1.2.2 Precedence: bulk Cc: wp-trac@lists.wordpress.org Auto-Submitted: auto-generated X-Mailer: Trac 1.2.2, by Edgewall Software To: undisclosed-recipients: ; References: <059.c6aa66ec67584456db0ae2a55c81136d@wordpress.org> X-Trac-Project: WordPress Trac In-Reply-To: <059.c6aa66ec67584456db0ae2a55c81136d@wordpress.org> Date: Wed, 08 Aug 2018 06:00:42 -0000 Reply-To: wp-hackers@lists.automattic.com Message-ID: <074.03bb288cf1c7bc0cc3ca25249061ca15@wordpress.org> X-URL: https://core.trac.wordpress.org/ X-Trac-Ticket-ID: 44707 X-Trac-Ticket-URL: https://core.trac.wordpress.org/ticket/44707#comment:4 Subject: Re: [WordPress Trac] #44707: The user should be able to create additional requests when previous duplicates are complete or archived --===============8026228139510718423== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit #44707: The user should be able to create additional requests when previous duplicates are complete or archived --------------------------------------------+------------------------------ Reporter: garrett-eclipse | Owner: (none) Type: defect (bug) | Status: new Priority: normal | Milestone: Awaiting Review Component: Privacy | Version: 4.9.6 Severity: normal | Resolution: Keywords: needs-refresh needs-unit-tests | Focuses: privacy --------------------------------------------+------------------------------ Changes (by garrett-eclipse): * keywords: needs-refresh reporter-feedback needs-unit-tests => needs- refresh needs-unit-tests Comment: Thanks @cc0a, Sorry looks like I got the user request stati incorrect, they should use dashes instead of underscores as seen in their register_post_status calls; https://github.com/WordPress/WordPress/blob/aab929b8d619bde14495a97cdc1eb7bdf1f1d487 /wp-includes/post.php#L318-L352 My bad, updated snippet; {{{#!php 'user_request', 'post_name__in' => array( $action_name ), // Action name stored in post_name column. 'title' => $email_address, // Email address stored in post_title column. 'post_status' => array( 'request-pending', 'request-confirmed' ), 'fields' => 'ids', ) ); }}} With that change this is good for some unit tests. I haven't written much unit tests so will defer to @desrosj for help but here's the guide; https://make.wordpress.org/core/handbook/testing/automated-testing /writing-phpunit-tests/ The tests should attempt to duplicate identical requests of the different stati and confirm that request-failed and request-confirmed are allowed duplicate requests while request-pending and request-confirmed block duplicates. Thanks again -- Ticket URL: WordPress Trac WordPress publishing platform --===============8026228139510718423==--