Merge pull request #11642 from JKingsnorth/CRM-21739
[civicrm-core.git] / tests / phpunit / api / v3 / PcpTest.php
index 73d0da3d51ef037394198a89f225abf26d47abe5..37c0a87b72a4fdc84611b725db1ea28408f2cbbe 100644 (file)
@@ -4,7 +4,7 @@
  * +--------------------------------------------------------------------+
  * | CiviCRM version 4.7                                                |
  * +--------------------------------------------------------------------+
- * | Copyright CiviCRM LLC (c) 2004-2017                                |
+ * | Copyright CiviCRM LLC (c) 2004-2018                                |
  * +--------------------------------------------------------------------+
  * | This file is a part of CiviCRM.                                    |
  * |                                                                    |
@@ -68,6 +68,15 @@ class api_v3_PcpTest extends CiviUnitTestCase {
     $this->getAndCheck($this->params, $result['id'], $this->entity);
   }
 
+  /**
+   * Test disable a PCP succeeds.
+   */
+  public function testDisablePcp() {
+    $result = civicrm_api3('Pcp', 'create', $this->params);
+    civicrm_api3('Pcp', 'create', array('id' => $result['id'], 'is_active' => 0));
+    $this->getAndCheck($this->params + array('is_active' => 0), $result['id'], $this->entity);
+  }
+
   /**
    * Test get function succeeds.
    *