CRM-20316 - Fix "New Mailing" regression. Update tests.
authorTim Otten <totten@civicrm.org>
Tue, 2 May 2017 03:12:32 +0000 (20:12 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 2 May 2017 03:12:32 +0000 (20:12 -0700)
`testWithoutParam_create()` asserts that *generally* you need to provide
some params to create a record.  This was true for Mailings in <=4.7.18
because `create_id` was required.  The main goal of a98504a72 was to make
`created_id` optional, which actually meant that *no data* would be
required (making `testWithoutParam_create()` non-applicable/inaccurate.

(This was obscured at the time because a98504a72 simultaneously made
`subject` mandatory, but that led to the regression in "New Mailing".  Since
neither `created_id` nor `subject` is required...  there's nothing left to
be required.  The correct behavior is to skip `testWithoutParam_create()`
for mailings.)

tests/phpunit/api/v3/SyntaxConformanceTest.php

index f560d2c98ea5b7a883adcfa960487a5ce6aa30de..7c040f616b5fa1a50e9d393d0d87f0bffd2738a6 100644 (file)
@@ -1081,6 +1081,9 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     if ($Entity === 'Setting') {
       $this->markTestSkipped('It seems OK for setting to skip here as it silently sips invalid params');
     }
+    elseif ($Entity === 'Mailing') {
+      $this->markTestSkipped('It seems OK for "Mailing" to skip here because you can create empty drafts');
+    }
     // should create php complaining that a param is missing
     civicrm_api3($Entity, 'Create');
   }